# 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('f395afde-3eba-4670-ae90-e5e1d5e132a7','a73504bc-9146-443c-a770-5bec96addc8d','3952b886-d3ef-4cd4-8b18-e975cbc82ef3','../lite/tree/../notebooks/index.html?path=399dec8a_4cc1_419b_ad36_1fe6f1aeeb63.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="3952b886-d3ef-4cd4-8b18-e975cbc82ef3" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('f395afde-3eba-4670-ae90-e5e1d5e132a7','3952b886-d3ef-4cd4-8b18-e975cbc82ef3')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('f395afde-3eba-4670-ae90-e5e1d5e132a7','3952b886-d3ef-4cd4-8b18-e975cbc82ef3')">Open In Tab</button></div><div id="a73504bc-9146-443c-a770-5bec96addc8d" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
