cfdm.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 that Dask array has been defined.
The returned array has the same mask hardness and fill value as the data.
Compare with
array
.Performance
compute
causes all delayed operations to be computed.New in version (cfdm): 1.11.2.0
See also
- Returns
An in-memory view of the data
Examples
>>> d = cfdm.Data([1, 2, 3.0], 'km') >>> d.compute() array([1., 2., 3.])
>>> from scipy.sparse import csr_array >>> d = cfdm.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.]])