cf.Data.compute

Data.compute()[source]

A view of the computed data.

In-place changes to the returned array might affect the underlying dask array, depending on how the dask array has been defined, including any delayed operations.

The returned array has the same mask hardness and fill values as the data.

Compare with array.

Performance

compute causes all delayed operations to be computed.

New in version 3.14.0.

Returns

An in-memory view of the data

Examples

>>> d = cf.Data([1, 2, 3.0], 'km')
>>> d.compute()
array([1., 2., 3.])
>>> from scipy.sparse import csr_array
>>> d = cf.Data(csr_array((2, 3)))
>>> d.compute()
<2x3 sparse array of type '<class 'numpy.float64'>'
        with 0 stored elements in Compressed Sparse Row format>
>>>: d.array
array([[0., 0., 0.],
       [0., 0., 0.]])
>>> d.compute().toarray()
array([[0., 0., 0.],
       [0., 0., 0.]])