numpy.load
来源:互联网 发布:汇通天下g7怎么样知乎 编辑:程序博客网 时间:2024/05/22 11:51
numpy.load(file, mmap_mode=None, allow_pickle=True, fix_imports=True, encoding=’ASCII’)[source]
Load arrays or pickled objects from .npy, .npz or pickled files.
Parameters:
file : file-like object or string
The file to read. File-like objects must support the seek() and read() methods. Pickled files require that the file-like object support the readline() method as well.
mmap_mode : {None, ‘r+’, ‘r’, ‘w+’, ‘c’}, optional
If not None, then memory-map the file, using the given mode (see numpy.memmap for a detailed description of the modes). A memory-mapped array is kept on disk. However, it can be accessed and sliced like any ndarray. Memory mapping is especially useful for accessing small fragments of large files without reading the entire file into memory.
allow_pickle : bool, optional
Allow loading pickled object arrays stored in npy files. Reasons for disallowing pickles include security, as loading pickled data can execute arbitrary code. If pickles are disallowed, loading object arrays will fail. Default: True
fix_imports : bool, optional
Only useful when loading Python 2 generated pickled files on Python 3, which includes npy/npz files containing object arrays. If fix_imports is True, pickle will try to map the old Python 2 names to the new names used in Python 3.
encoding : str, optional
What encoding to use when reading Python 2 strings. Only useful when loading Python 2 generated pickled files on Python 3, which includes npy/npz files containing object arrays. Values other than ‘latin1’, ‘ASCII’, and ‘bytes’ are not allowed, as they can corrupt numerical data. Default: ‘ASCII’
Returns:
result : array, tuple, dict, etc.
Data stored in the file. For .npz files, the returned instance of NpzFile class must be closed to avoid leaking file descriptors.
Raises:
IOError
If the input file does not exist or cannot be read.
ValueError
The file contains an object array, but allow_pickle=False given.
- numpy.load
- numpy.load和numpy.save
- NumPy 文件存取 tofile,fromfile, load,save
- Numpy
- numpy
- numpy
- Numpy
- numpy
- numpy
- numpy
- NumPy
- numpy
- numpy
- Numpy
- numpy
- Numpy
- Numpy
- Numpy
- numpy.mean
- UVA 10689 Yet another Number Sequence(矩阵快速幂求Fib数列)
- How to Install GMP in Ubuntu
- 传智博客 js学习(二)
- 内存管理的基础
- numpy.load
- 算法 - 排序 - 选择排序
- 2016年的C++常见的面试问题详解~搬至牛客网~strcpy
- 10Redis键空间通知(keyspace notifications)
- Uva439——Knight Moves
- OkHttp的使用
- iOS——iOS8 Photo库 PHAsset之坑
- 练习
- JAVA编程指南 --继承