cf.Data.binary_mask¶
-
Data.
binary_mask
¶ A binary (0 and 1) mask of the data array.
The binary mask’s data array comprises dimensionless 32-bit integers and has 0 where the data array has missing data and 1 otherwise.
See also
- Returns
Data
The binary mask.
Examples
>>> d = cf.Data([[0, 1, 2, 3]], 'm') >>> m = d.binary_mask >>> m <CF Data(1, 4): [[0, ..., 0]] 1> >>> print(m.array) [[0 0 0 0]] >>> d[0, 1] = cf.masked >>> print(d.binary_mask.array) [[0 1 0 0]]