# 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('9e55f3d2-37b9-433b-a7ab-ea54e0200c4a','3b954550-dbc9-4c43-bb8b-528b2cce8534','053b78b7-a636-4044-ac0e-2c775de11fbd','../lite/tree/../notebooks/index.html?path=9e05a2c2_632d_422e_9f7a_6bd82395cf3d.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="053b78b7-a636-4044-ac0e-2c775de11fbd" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('9e55f3d2-37b9-433b-a7ab-ea54e0200c4a','053b78b7-a636-4044-ac0e-2c775de11fbd')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('9e55f3d2-37b9-433b-a7ab-ea54e0200c4a','053b78b7-a636-4044-ac0e-2c775de11fbd')">Open In Tab</button></div><div id="3b954550-dbc9-4c43-bb8b-528b2cce8534" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
