numpy.save是否跨平台? [英] Is numpy.save cross platform?

查看:113
本文介绍了numpy.save是否跨平台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我使用numpy.save()将一个numpy数组保存到文件"arr.npy",并使用特定的python版本,numpy版本和OS进行了此操作.

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.

我可以在使用不同版本的python或numpy的其他操作系统上使用numpy.load()加载arr.npy吗?是否有任何限制,例如向后兼容?

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?

推荐答案

是. .npy格式记录在这里:

Yes. The .npy format is documented here:

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

源代码(强调我的):

.npy格式是NumPy中的标准二进制文件格式,用于 将单个任意NumPy数组保留在磁盘上.格式存储 重建模型所需的所有形状和dtype信息 正确地排列即使在具有不同体系结构的另一台计算机上.

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.

这篇关于numpy.save是否跨平台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆