[Numpy-discussion] Reconstruct multidimensional array from buffer without shape

Paul Anton Letnes paul.anton.letnes@gmail....
Fri Aug 19 14:13:51 CDT 2011

On 19. aug. 2011, at 19.57, Ian wrote:

> Right. I'm new to NumPy so I figured I'd check if there was some nifty way of preserving the shape without storing it in the database that I hadn't discovered yet. No worries, I'll store the shape alongside the array. Thanks for the reply.
I love the h5py package so I keep recommending it (and pytables is supposed to be good, I think?). h5py stores files in hdf5, which is readable from C,C++,fortran,java,python... It also keeps track of shape and you can store other metadata (e.g. strings) as desired.

Also I believe the numpy format (see e.g. http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html#numpy.savez) can do the same, although I don't think performance scales as well for huge arrays, and it's not language-neutral (to my knowledge).


More information about the NumPy-Discussion mailing list