blosc2.pack_array2¶
- blosc2.pack_array2(arr: ndarray, chunksize: int | None = None, **kwargs: dict) bytes | int [source]¶
Pack (compress) a NumPy array. This method is faster and does not have a 2 GB limitation.
- Parameters:
- Returns:
out – The serialized version (cframe) of the array. If urlpath is provided, the number of bytes in file is returned instead.
- Return type:
bytes | int
Examples
>>> import numpy as np >>> a = np.arange(1e6) >>> cframe = blosc2.pack_array2(a) >>> len(cframe) < a.size * a.itemsize True
See also