Is there a method to save a numpy memmap array into a .npy
file? Apparently, there is a method to load such an array from a .npy
file as follows
data = numpy.load("input.npy", mmap_mode='r')
but flushing the file is not equivalent to storing it in a .npy
format.
If flushing is the only way to go then is there a way to infer the shape of the stored array? I would prefer to have dynamic shape which is automatically stored and retrieved (possibly as memmap again) in another script.
I have searched on various places about this but didn't find get any result. I way to store into .npy
I do now is
numpy.save(output.filename, output.copy())
which defeats the idea of using memmap but preserves the shape.
NOTE: I know about hdf5 and h5py but I was wondering if there is a pure numpy solution to this.