cf.Count.set_data

Count.set_data(data, copy=True)[source]

Set the data.

The units, calendar and fill value of the incoming Data instance are removed prior to insertion.

New in version 3.0.0.

Parameters
data: Data

The data to be inserted.

copy: bool, optional

If False then do not copy the data prior to insertion. By default the data are copied.

Returns

None

Examples:

>>> d = 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