blosc2.asarray#

blosc2.asarray(array: ndarray, **kwargs: dict) NDArray#

Convert the array to an NDArray.

Parameters:
  • array (array_like) – An array supporting numpy array interface.

  • kwargs (dict, optional) – Keyword arguments that are supported by the empty() constructor.

Returns:

out – An new NDArray made of array.

Return type:

NDArray

Examples

>>> import blosc2
>>> import numpy as np
>>> # Create some data
>>> shape = [25, 10]
>>> a = np.arange(0, np.prod(shape), dtype=np.int64).reshape(shape)
>>> # Create a NDArray from a NumPy array
>>> nda = blosc2.asarray(a)