Write an array to an NPY file, including a header.
If the array is neither C-contiguous nor Fortran-contiguous AND the file_like object is not a real file object, this function will have to copy data in memory.
An open, writable file object, or similar object with a .write() method.
The array to write to disk.
The version number of the format. None means use the oldest supported version that is able to store the data. Default: None
Whether to allow writing pickled data. Default: True
Additional keyword arguments to pass to pickle.dump, excluding ‘protocol’. These are only useful when pickling objects in object arrays to Python 2 compatible format.
If the array cannot be persisted. This includes the case of allow_pickle=False and array being an object array.
If the array contains Python objects as part of its dtype, the process of pickling them may raise various errors if the objects are not picklable.
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.lib.format.write_array.html