日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

python读取npy文件_python – 如何在磁盘上创建一个numpy .npy文件?

發(fā)布時間:2023/12/10 python 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python读取npy文件_python – 如何在磁盘上创建一个numpy .npy文件? 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

當(dāng)我讀到Sven的回復(fù)時,我也有同樣的問題,感到失望.似乎numpy將錯過一些關(guān)鍵的功能,如果你不能有一個巨大的數(shù)組文件,并在一小塊工作一次.您的案例似乎接近使用.npy格式的原始理性的一個用例(參見:

http://svn.scipy.org/svn/numpy/trunk/doc/neps/npy-format.txt).

然后我碰到了numpy.lib.format,這似乎是有用的好東西.我不知道為什么這個功能是不可用的numpy根包.與HDF5相比,它的主要優(yōu)點在于它帶有麻煩.

>>> print numpy.lib.format.open_memmap.__doc__

"""

Open a .npy file as a memory-mapped array.

This may be used to read an existing file or create a new one.

Parameters

----------

filename : str

The name of the file on disk. This may not be a filelike object.

mode : str, optional

The mode to open the file with. In addition to the standard file modes,

'c' is also accepted to mean "copy on write". See `numpy.memmap` for

the available mode strings.

dtype : dtype, optional

The data type of the array if we are creating a new file in "write"

mode.

shape : tuple of int, optional

The shape of the array if we are creating a new file in "write"

mode.

fortran_order : bool, optional

Whether the array should be Fortran-contiguous (True) or

C-contiguous (False) if we are creating a new file in "write" mode.

version : tuple of int (major, minor)

If the mode is a "write" mode, then this is the version of the file

format used to create the file.

Returns

-------

marray : numpy.memmap

The memory-mapped array.

Raises

------

ValueError

If the data or the mode is invalid.

IOError

If the file is not found or cannot be opened correctly.

See Also

--------

numpy.memmap

"""

總結(jié)

以上是生活随笔為你收集整理的python读取npy文件_python – 如何在磁盘上创建一个numpy .npy文件?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。