numpy.lib.format.open_memmap
- 
lib.format.open_memmap(filename, mode='r+', dtype=None, shape=None, fortran_order=False, version=None)[source]
- 
Open a .npy file as a memory-mapped array. This may be used to read an existing file or create a new one. - Parameters
- 
- 
filenamestr or path-like
- 
The name of the file on disk. This may not be a file-like object. 
- 
modestr, optional
- 
The mode in which to open the file; the default is ‘r+’. In addition to the standard file modes, ‘c’ is also accepted to mean “copy on write.” See memmapfor the available mode strings.
- 
dtypedata-type, optional
- 
The data type of the array if we are creating a new file in “write” mode, if not, dtypeis ignored. The default value is None, which results in a data-type offloat64.
- 
shapetuple of int
- 
The shape of the array if we are creating a new file in “write” mode, in which case this parameter is required. Otherwise, this parameter is ignored and is thus optional. 
- 
fortran_orderbool, optional
- 
Whether the array should be Fortran-contiguous (True) or C-contiguous (False, the default) if we are creating a new file in “write” mode. 
- 
versiontuple of int (major, minor) or None
- 
If the mode is a “write” mode, then this is the version of the file format used to create the file. None means use the oldest supported version that is able to store the data. Default: None 
 
- 
- Returns
- 
- 
marraymemmap
- 
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 
    © 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
    https://numpy.org/doc/1.21/reference/generated/numpy.lib.format.open_memmap.html