xarray.IndexVariable.isnull

xarray.IndexVariable.isnull#

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

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

Returns:

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

See also

pandas.isnull

Examples

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