xarray.IndexVariable.notnull

xarray.IndexVariable.notnull#

IndexVariable.notnull(keep_attrs=None)[source]#

Test each value in the array for whether it is not a missing value.

Returns:

notnull (Variable) – Same type and shape as object, but the dtype of the data is bool.

See also

pandas.notnull

Examples

>>> var = xr.Variable("x", [1, np.nan, 3])
>>> var
<xarray.Variable (x: 3)>
array([ 1., nan,  3.])
>>> var.notnull()
<xarray.Variable (x: 3)>
array([ True, False,  True])