Set data array elements depending on a condition.
Elements are set differently depending on where the condition is True or False. Two assignment values are given. From one of them, the data array is set where the condition is True and where the condition is False, the data array is set from the other.
Each assignment value may either contain a single datum, or is an array-like object which is broadcastable shape of the data array.
Missing data
The treatment of missing data elements depends on the value of the hardmask attribute. If it is True then masked elements will not unmasked, otherwise masked elements may be set to any value.
In either case, unmasked elements may be set to any value (including missing data).
Unmasked elements may be set to missing data by assignment to the cf.masked constant or by assignment to a value which contains masked elements.
See also
Parameters: |
x, y :
|
---|---|
Returns: | out : cf.Data |
Examples: |