numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersRaisesReturnsBackRef
open_memmap(filename, mode='r+', dtype=None, shape=None, fortran_order=False, version=None)

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

Parameters

filename : str or path-like

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

mode : str, 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 memmap for the available mode strings.

dtype : data-type, optional

The data type of the array if we are creating a new file in "write" mode, if not, dtype is ignored. The default value is None, which results in a data-type of float64 .

shape : tuple 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_order : bool, 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.

version : tuple 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

Raises

ValueError

If the data or the mode is invalid.

OSError

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

Returns

marray : memmap

The memory-mapped array.

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

See Also

numpy.memmap

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.memmap numpy.load numpy.lib.format

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/format.py#791
type: <class 'function'>
Commit: