[Numpy-discussion] Error in numpy.load example?

Sébastien Barthélémy barthelemy at crans.org
Thu Jan 5 09:02:30 EST 2012


Hi all,

the doc http://docs.scipy.org/doc/numpy/reference/generated/numpy.load.html
contains the following example:

 Store compressed data to disk, and load it again:

 >>> np.savez('/tmp/123.npz', a=np.array([[1, 2, 3], [4, 5, 6]]),
b=np.array([1, 2]))
 >>> data = np.load('/tmp/123.npy')

However http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html
says:

 numpy.savez(file, *args, **kwds)¶

     Save several arrays into a single file in uncompressed .npz format.

Moreover, this last page points to an undocumented numpy.savez_compressed
function, which is also non-existent in my version of numpy (1.5.1-2ubuntu2).

That's quite confusing.

>From the following thread, it seems the arrays are stored uncompressed
in a zipfile.
http://article.gmane.org/gmane.comp.python.numeric.general/38378

Can somebody confirm that/fix the docs?

Cheers
-- Sébastien



More information about the NumPy-Discussion mailing list