blosc2.asarray#
- blosc2.asarray(array: ndarray | C2Array, **kwargs: Any) NDArray #
Convert the array to an NDArray.
- Parameters:
- Returns:
out – An new NDArray made of
array
.- Return type:
Notes
This will create the NDArray chunk-by-chunk directly from the input array, without the need to create a contiguous NumPy array internally. This can be used for ingesting e.g. disk or network based arrays very effectively and without consuming lots of memory.
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)