MCPcopy
hub / github.com/pydata/xarray / isnull

Method isnull

xarray/core/variable.py:2341–2373  ·  view source on GitHub ↗

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 --------

(self, keep_attrs: bool | None = None)

Source from the content-addressed store, hash-verified

2339 return duck_array_ops.reshape(variable.data, shape), tuple(axes)
2340
2341 def isnull(self, keep_attrs: bool | None = None):
2342 """Test each value in the array for whether it is a missing value.
2343
2344 Returns
2345 -------
2346 isnull : Variable
2347 Same type and shape as object, but the dtype of the data is bool.
2348
2349 See Also
2350 --------
2351 pandas.isnull
2352
2353 Examples
2354 --------
2355 >>> var = xr.Variable("x", [1, np.nan, 3])
2356 >>> var
2357 <xarray.Variable (x: 3)> Size: 24B
2358 array([ 1., nan, 3.])
2359 >>> var.isnull()
2360 <xarray.Variable (x: 3)> Size: 3B
2361 array([False, True, False])
2362 """
2363 from xarray.computation.apply_ufunc import apply_ufunc
2364
2365 if keep_attrs is None:
2366 keep_attrs = _get_keep_attrs(default=True)
2367
2368 return apply_ufunc(
2369 duck_array_ops.isnull,
2370 self,
2371 dask="allowed",
2372 keep_attrs=keep_attrs,
2373 )
2374
2375 def notnull(self, keep_attrs: bool | None = None):
2376 """Test each value in the array for whether it is not a missing value.

Callers 15

_get_index_and_itemsMethod · 0.45
_check_fill_valuesFunction · 0.45
encodeMethod · 0.45
nanfirstFunction · 0.45
nanlastFunction · 0.45
equivalentFunction · 0.45
interpMethod · 0.45
func_interpolate_naFunction · 0.45
_get_valid_fill_maskFunction · 0.45
_access_through_seriesFunction · 0.45
to_masked_arrayMethod · 0.45
format_itemsFunction · 0.45

Calls 2

_get_keep_attrsFunction · 0.90
apply_ufuncFunction · 0.90

Tested by 15

test_isnullFunction · 0.36
test_isnull_with_daskFunction · 0.36
test_coarsen_da_reduceFunction · 0.36
test_unary_opsMethod · 0.36
test_padMethod · 0.36
test_is_nullMethod · 0.36
test_polyfitMethod · 0.36