cfdm.core.abstract.PropertiesDataBounds.set_data¶
-
PropertiesDataBounds.set_data(data, copy=True, inplace=True)[source]¶ Set the data.
The units, calendar and fill value of the incoming
Datainstance are removed prior to insertion.New in version (cfdm): 1.7.0
- Parameters
- data: data_like
The data to be inserted.
A data_like object is any object that can be converted to a
Dataobject, i.e.numpyarray_like objects,Dataobjects, and cfdm.core instances that containDataobjects.- copy:
bool, optional If False then do not copy the data prior to insertion. By default the data are copied.
- inplace:
bool, optional: If False then do not do the operation in-place and return a new, modified
PropertiesDataBoundsinstance. By default the operation is in-place andNoneis returned.New in version (cfdm): 1.8.7.0
- Returns
Examples:
>>> f = cfdm.core.PropertiesDataBounds() >>> f.set_data([1, 2, 3]) >>> f.has_data() True >>> f.get_data() <Data(3): [1, 2, 3]> >>> f.data <Data(3): [1, 2, 3]> >>> f.del_data() <Data(3): [1, 2, 3]> >>> g = f.set_data([4, 5, 6], inplace=False) >>> g.data <Data(3): [4, 5, 6]> >>> f.has_data() False >>> print(f.get_data(None)) None >>> print(f.del_data(None)) None