cf.Field.varray

Field.varray

A numpy array view of the data array.

Deprecated at version 3.14.0. Data are now stored as dask arrays for which, in general, a numpy array view is not robust.

Changing the elements of the returned view changes the data array.

Examples

>>> f.data
<CF Data(5): [0, ... 4] kg m-1 s-2>
>>> a = f.array
>>> type(a)
<type 'numpy.ndarray'>
>>> print(a)
[0 1 2 3 4]
>>> a[0] = 999
>>> print(a)
[999 1 2 3 4]
>>> print(f.array)
[999 1 2 3 4]
>>> f.data
<CF Data(5): [999, ... 4] kg m-1 s-2>