# xarray.Dataset.notnull

#### Dataset.notnull(keep_attrs=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/common.py#L1325-L1366)

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

* **Parameters:**
  **keep_attrs** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True, the attributes (attrs) will be copied from
  the original object to the new one. If False, the new
  object will be returned without attributes.
* **Returns:**
  **notnull** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray) or [`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – Same type and shape as object, but the dtype of the data is bool.

#### SEE ALSO
[`pandas.notnull`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.notnull.html#pandas.notnull)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('edccf418-fa5c-4e5b-93d5-07fd80df1762','f9b9425e-6d23-4365-a3a8-28b8ab419ddb','dce5e35b-f92c-4d1e-8b26-308b11ddb865','../lite/tree/../notebooks/index.html?path=4df58ba5_f687_43d7_a771_e3b97d6fe248.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> array = xr.DataArray([1, np.nan, 3], dims="x")
>>> array
<xarray.DataArray (x: 3)> Size: 24B
array([ 1., nan,  3.])
Dimensions without coordinates: x
>>> array.notnull()
<xarray.DataArray (x: 3)> Size: 3B
array([ True, False,  True])
Dimensions without coordinates: x
```

<div id="dce5e35b-f92c-4d1e-8b26-308b11ddb865" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('edccf418-fa5c-4e5b-93d5-07fd80df1762','dce5e35b-f92c-4d1e-8b26-308b11ddb865')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('edccf418-fa5c-4e5b-93d5-07fd80df1762','dce5e35b-f92c-4d1e-8b26-308b11ddb865')">Open In Tab</button></div><div id="f9b9425e-6d23-4365-a3a8-28b8ab419ddb" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
