🍾 Xarray is now 10 years old! 🎉

xarray.Variable.isnull

xarray.Variable.isnull#

Variable.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)> Size: 24B
array([ 1., nan,  3.])
>>> var.isnull()
<xarray.Variable (x: 3)> Size: 3B
array([False,  True, False])