I have a numpy-memmap matrix S
of size 12 GB. And I'm trying to argsort each row. To do that I have defined another memmap array first_k
to save the result. The problem is that a memory error occurs.
Here is the code:
first_k = np.memmap('first_k', dtype='float32', mode='w+', shape=S.shape)
first_k[:] = np.memmap.argsort(S, axis=1)
Any possible solutions? I am thinking to process it in slices ...
Thanks in advance
Finally, I process the memmap in slices. Here is the code.