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

Method notnull

xarray/core/variable.py:2375–2407  ·  view source on GitHub ↗

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

(self, keep_attrs: bool | None = None)

Source from the content-addressed store, hash-verified

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.
2377
2378 Returns
2379 -------
2380 notnull : Variable
2381 Same type and shape as object, but the dtype of the data is bool.
2382
2383 See Also
2384 --------
2385 pandas.notnull
2386
2387 Examples
2388 --------
2389 >>> var = xr.Variable("x", [1, np.nan, 3])
2390 >>> var
2391 <xarray.Variable (x: 3)> Size: 24B
2392 array([ 1., nan, 3.])
2393 >>> var.notnull()
2394 <xarray.Variable (x: 3)> Size: 3B
2395 array([ True, False, True])
2396 """
2397 from xarray.computation.apply_ufunc import apply_ufunc
2398
2399 if keep_attrs is None:
2400 keep_attrs = _get_keep_attrs(default=True)
2401
2402 return apply_ufunc(
2403 duck_array_ops.notnull,
2404 self,
2405 dask="allowed",
2406 keep_attrs=keep_attrs,
2407 )
2408
2409 @property
2410 def imag(self) -> Variable:

Callers 15

rankMethod · 0.95
convert_calendarFunction · 0.45
infer_datetime_unitsFunction · 0.45
infer_timedelta_unitsFunction · 0.45
histFunction · 0.45
newplotfuncFunction · 0.45
sortbyMethod · 0.45
_get_nan_block_lengthsFunction · 0.45
_sum_of_weightsMethod · 0.45
_countsMethod · 0.45
_cov_corrFunction · 0.45

Calls 2

_get_keep_attrsFunction · 0.90
apply_ufuncFunction · 0.90

Tested by 13

np_cov_indFunction · 0.36
np_covFunction · 0.36
np_corr_indFunction · 0.36
np_corrFunction · 0.36
test_covcorr_consistencyFunction · 0.36
test_autocovFunction · 0.36
expected_weightedFunction · 0.36
test_groupby_drops_nansFunction · 0.36
test_unary_opsMethod · 0.36
test_is_nullMethod · 0.36