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