cfdm.core.Data.array

Data.array

Return an independent numpy array containing the data.

If a fill value has been set (see set_fill_value) then it will be used, otherwise the default numpy fill value appropriate to the data type will be used.

Returns
numpy.ndarray

An independent numpy array of the data.

Examples

>>> d = cfdm.core.Data([1, 2, 3.0], 'km')
>>> n = d.array
>>> isinstance(n, numpy.ndarray)
True
>>> print(n)
[1. 2. 3.]
>>> n[0] = 88
>>> d
<Data(3): [1.0, 2.0, 3.0] km>