当我读了Sven的回复时,我也有同样的问题,很失望。 numpy似乎会错过一些重要的功能。 如果你有一个巨大的数组文件,不能用小块工作一次。 您的案例似乎接近使用. npy格式的原始合理用例(
3358 SVN.scipy.org/SVN/numpy/trunk/doc/neps/npy-format.txt )。
然后我遇到了numpy.lib.format。 这似乎是有用的好东西。 我不知道为什么这个功能是不可用的numpy根软件包。 与高清F5相比,其主要优点是有故障。
print numpy.lib.format.open _ me mmap._ _ doc _ _
''''
opena.npyfileasamemory -映射阵列。
thismaybeusedtoreadanexistingfileorcreateanewone。
参数化
------------
filename : str
thenameofthefileondisk.thismaynotbeafilelikeobject。
mode : str,可选
themodetoopenthefilewith.inadditiontothestandardfilemodes,
' c ' isalsoacceptedtomean ' copyonwrite '.see ` numpy.me mmap ` for
the available模式字符串。
dtype : dtype,可选
thedatatypeofthearrayifwearecreatinganewfilein ' write '
模式。
shape : tuple of int,可选
theshapeofthearrayifwearecreatinganewfilein ' write '
模式。
fortran_order : bool,optional
无线保真(true ) or
c连续(假) ifwearecreatinganewfilein ' write ' mode。
版本: tupleofint (major,minor )。
If the mode is a 'write' mode,then this is the version of the file
格式使用到创建the file。
返回
------------
marray : numpy.memmap
The memory-mapped array。
雷耶斯
--------
值错误
If the data or the mode is invalid。
IO错误
ifthefileisnotfoundorcannotbeopenedcorrectly。
See Also
------------
numpy.memmap
''''