cf.Data.empty¶
-
classmethod
Data.empty(shape, dtype=None, units=None, calendar=None, fill_value=None, chunk=True)[source]¶ Create a new data array without initializing the elements.
Note that the mask of the returned empty data is hard.
- Parameters
- shape:
intortupleofint The shape of the new array.
- dtype:
numpy.dtypeor any object convertible tonumpy.dtype The data-type of the new array. By default the data-type is
float.- units:
strorUnits The units for the new data array.
- calendar:
str, optional The calendar for reference time units.
- fill_value: optional
The fill value of the data. By default, or if set to
None, thenumpyfill value appropriate to the array’s data-type will be used (seenumpy.ma.default_fill_value). Ignored if the source parameter is set.The fill value may also be set after initialisation with the
set_fill_valuemethod.- Parameter example:
fill_value=-999.
- shape:
- Returns
Examples:
>>> d = cf.Data.empty((96, 73))