blosc2.NDArray.save#

NDArray.save(urlpath: str, contiguous=True, **kwargs: Any) None#

Save the array to a file.

This is a convenience function that calls the copy() method with the urlpath parameter and the additional keyword arguments provided.

See save() for more information.

Parameters:
  • urlpath (str) – The path where the array will be saved.

  • contiguous (bool, optional) – Whether to save the array contiguously.

  • kwargs (dict, optional) – Additional keyword arguments supported by the save() method.

Returns:

out

Return type:

None

Examples

>>> import blosc2
>>> import numpy as np
>>> shape = (10, 10)
>>> blocks = (10, 10)
>>> dtype = np.bool_
>>> # Create a NDArray with default chunks
>>> a = blosc2.zeros(shape, blocks=blocks, dtype=dtype)
>>> # Save the array to a file
>>> a.save("array.b2frame")