cfdm.Bounds.get_data¶
-
Bounds.
get_data
(default=ValueError(), _units=True, _fill_value=True)[source]¶ Return the data.
Note that the data are returned in a
Data
object. Use thearray
attribute of theData
instance to return the data as an independentnumpy
array.New in version (cfdm): 1.7.0
- Parameters
- default: optional
Return the value of the default parameter if data have not been set.
If set to an
Exception
instance then it will be raised instead.
- Returns
Data
The data.
Examples
>>> f = cfdm.Field( ... properties={'standard_name': 'surface_altitude'}) >>> d = cfdm.Data(range(10)) >>> f.set_data(d) >>> f.has_data() True >>> f.get_data() <Data(10): [0, ..., 9]>
>>> f.del_data() <Data(10): [0, ..., 9]> >>> f.has_data() False >>> print(f.get_data(None)) None >>> print(f.del_data(None)) None