# xarray.IndexVariable.notnull

#### IndexVariable.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('261b6ecf-25f2-402f-a5a5-5b57302b653e','8616843e-570b-4ecd-b3ea-0dc08722b741','82d63fc4-905e-485d-9a5c-a5c1832f22f1','../lite/tree/../notebooks/index.html?path=4e027b97_33b6_46be_a82c_dd0d2a05d702.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="82d63fc4-905e-485d-9a5c-a5c1832f22f1" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('261b6ecf-25f2-402f-a5a5-5b57302b653e','82d63fc4-905e-485d-9a5c-a5c1832f22f1')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('261b6ecf-25f2-402f-a5a5-5b57302b653e','82d63fc4-905e-485d-9a5c-a5c1832f22f1')">Open In Tab</button></div><div id="8616843e-570b-4ecd-b3ea-0dc08722b741" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
