# xarray.Variable.notnull

#### Variable.notnull(keep_attrs=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/variable.py#L2605-L2637)

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

* **Returns:**
  **notnull** ([`Variable`](xarray.Variable.html.md#xarray.Variable)) – 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('8f3f05cd-6c5b-499f-adcd-4d7c10dc4de0','1fdcfe86-7e1c-43dd-acb4-3b359a2787ef','18904e87-38b2-48f7-bec6-b0fb1de2cee0','../lite/tree/../notebooks/index.html?path=a40e1663_94cb_486b_bba9_4f44e710a011.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> var = xr.Variable("x", [1, np.nan, 3])
>>> var
<xarray.Variable (x: 3)> Size: 24B
array([ 1., nan,  3.])
>>> var.notnull()
<xarray.Variable (x: 3)> Size: 3B
array([ True, False,  True])
```

<div id="18904e87-38b2-48f7-bec6-b0fb1de2cee0" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('8f3f05cd-6c5b-499f-adcd-4d7c10dc4de0','18904e87-38b2-48f7-bec6-b0fb1de2cee0')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('8f3f05cd-6c5b-499f-adcd-4d7c10dc4de0','18904e87-38b2-48f7-bec6-b0fb1de2cee0')">Open In Tab</button></div><div id="1fdcfe86-7e1c-43dd-acb4-3b359a2787ef" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
