# xarray.Variable.notnull

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

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('a8368af1-be45-48d8-9e49-b6de785856fb','f6ef45ed-aa87-4e8f-917c-15860d05aa19','67007d0b-ace2-4634-a6db-37d4d8e63e07','../lite/tree/../notebooks/index.html?path=35a7bbfe_a3bd_4429_806c_b04d17ab45f4.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="67007d0b-ace2-4634-a6db-37d4d8e63e07" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('a8368af1-be45-48d8-9e49-b6de785856fb','67007d0b-ace2-4634-a6db-37d4d8e63e07')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('a8368af1-be45-48d8-9e49-b6de785856fb','67007d0b-ace2-4634-a6db-37d4d8e63e07')">Open In Tab</button></div><div id="f6ef45ed-aa87-4e8f-917c-15860d05aa19" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
