cf.DimensionCoordinate.has_data¶
-
DimensionCoordinate.
has_data
()[source]¶ Whether a data has been set.
New in version (cfdm): 1.7.0
- Returns
bool
True if a data have been set, otherwise False.
Examples:
>>> f = cf.DimensionCoordinate() >>> f.set_data([1, 2, 3]) >>> f.has_data() True >>> f.get_data() <CF Data(3): [1, 2, 3]> >>> f.data <CF Data(3): [1, 2, 3]> >>> f.del_data() <CF Data(3): [1, 2, 3]> >>> g = f.set_data([4, 5, 6], inplace=False) >>> g.data <CF Data(3): [4, 5, 6]> >>> f.has_data() False >>> print(f.get_data(None)) None >>> print(f.del_data(None)) None