Error in numpy.load example?

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

Hi Sebastien, Le 05/01/2012 15:02, Sébastien Barthélémy a écrit :
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).
Indeed, this online doc is not consistent with the numpy.savez *version 1.5*... [3] It seems there was an API update between 1.5 and 1.6 ([1][2]). (As a Debian testing user, I was also unaware of this change. Thanks for pointing that out, at least for me ! ) Now, I think Sebastien's question raises an interesting practical issue : If I'm correct, there is no place in the HTML page where the numpy version is written, except in <title> (and except the root of the manual http://docs.scipy.org/doc/numpy/reference/index.html ) Maybe, there should be some "top page version indicator". And possibly some way (a drop down menu ??) to switch between versions. (I don't know how this would fit in the Sphinx template system however...) What do other people think ? Best, Pierre [1] http://docs.scipy.org/doc/numpy-1.5.x/reference/generated/numpy.savez.html#n... [2] http://docs.scipy.org/doc/numpy-1.6.0/reference/generated/numpy.savez.html#n... [3] There is even a ticket about this ! http://projects.scipy.org/numpy/ticket/1696
participants (2)
-
Pierre Haessig
-
Sébastien Barthélémy