Is numpy.save cross platform?

有些话、适合烂在心里 提交于 2019-12-10 13:57:54

问题


Suppose I save a numpy array to a file, "arr.npy", using numpy.save() and that I do this using a particular python version, numpy version, and OS.

Can I load, using numpy.load(), arr.npy on a different OS using a different version of python or numpy? Are there any restrictions, such as backwards compatibility?


回答1:


Yes. The .npy format is documented here:

https://github.com/numpy/numpy/blob/master/doc/neps/npy-format.rst

Note this comment in the source code (emphasis mine):

The .npy format is the standard binary file format in NumPy for persisting a single arbitrary NumPy array on disk. The format stores all of the shape and dtype information necessary to reconstruct the array correctly even on another machine with a different architecture.



来源:https://stackoverflow.com/questions/28953804/is-numpy-save-cross-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!