# xarray.IndexVariable.notnull

#### IndexVariable.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('f0b447c7-543b-4dd2-ab37-7987befb3520','182cdec1-313a-485b-bf6c-f9cf05ae7a0b','8cd3b912-b07c-4bda-9ac9-c53ac8275817','../lite/tree/../notebooks/index.html?path=35629b6e_38c1_4b8a_a006_d03ff8101c4a.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="8cd3b912-b07c-4bda-9ac9-c53ac8275817" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('f0b447c7-543b-4dd2-ab37-7987befb3520','8cd3b912-b07c-4bda-9ac9-c53ac8275817')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('f0b447c7-543b-4dd2-ab37-7987befb3520','8cd3b912-b07c-4bda-9ac9-c53ac8275817')">Open In Tab</button></div><div id="182cdec1-313a-485b-bf6c-f9cf05ae7a0b" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
