bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / format / read_array
function
numpy.lib.format:read_array
source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_format_impl.py :780
Signature
def read_array ( fp , allow_pickle = False , pickle_kwargs = None , * , max_header_size = 10000 ) Summary
Read an array from an NPY file.
Parameters
fp: file_like objectIf this is not a real file object, then this may take extra memory and time.
allow_pickle: bool, optionalWhether to allow writing pickled data. Default: False
pickle_kwargs: dictAdditional keyword arguments to pass to pickle.load. These are only useful when loading object arrays saved on Python 2.
max_header_size: int, optionalMaximum allowed size of the header. Large headers may not be safe to load securely and thus require explicitly passing a larger value. See
ast.literal_eval()for details. This option is ignored whenallow_pickleis passed. In that case the file is by definition trusted and the limit is unnecessary.
Returns
array: ndarrayThe array from the data on disk.
Raises
: ValueErrorIf the data is invalid, or allow_pickle=False and the file contains an object array.
Aliases
-
numpy.lib._format_impl.read_array