cfdm.core.FieldAncillary.del_data¶
-
FieldAncillary.
del_data
(default=ValueError())[source]¶ Remove the data.
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 removed data.
Examples
>>> f = cfdm.core.FieldAncillary() >>> 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