blosc2.unpack_array2#

blosc2.unpack_array2(cframe)#

Unpack (decompress) a packed NumPy array via a cframe.

Parameters:

cframe (bytes) – The packed array to be restored.

Returns:

out – The unpacked NumPy array.

Return type:

ndarray

Raises:
  • TypeError – If cframe is not of type bytes, or not a cframe.

  • RunTimeError – If some other problem is detected.

Examples

>>> import numpy as np
>>> a = np.arange(1e6)
>>> cframe = blosc2.pack_array2(a)
>>> len(cframe) < a.size*a.itemsize
True
>>> a2 = blosc2.unpack_array2(cframe)
>>> np.array_equal(a, a2)
True