blosc2.NDArray.fields#

property NDArray.fields: dict#

Dictionary with the fields of the structured array.

Returns:

fields – A dictionary with the fields of the structured array.

Return type:

dict

See also

NDField

Examples

>>> import blosc2
>>> import numpy as np
>>> shape = (10,)
>>> dtype = np.dtype([('a', np.int32), ('b', np.float64)])
>>> # Create a structured array
>>> sa = blosc2.zeros(shape, dtype=dtype)
>>> # Check that fields are equal
>>> assert sa.fields['a'] == sa.fields['b']