# xarray.Variable.isnull

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

Test each value in the array for whether it is a missing value.

* **Returns:**
  **isnull** ([`Variable`](xarray.Variable.html.md#xarray.Variable)) – Same type and shape as object, but the dtype of the data is bool.

#### SEE ALSO
[`pandas.isnull`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isnull.html#pandas.isnull)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('7959dd59-b811-4aaf-b8c1-f84bb154a8e5','6d237786-5616-4825-b006-2ebdab77e323','266a216b-3129-43ef-8f76-41008f2b61d2','../lite/tree/../notebooks/index.html?path=6da5d05a_9dad_4bbe_a127_2cc4f59729d6.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.isnull()
<xarray.Variable (x: 3)> Size: 3B
array([False,  True, False])
```

<div id="266a216b-3129-43ef-8f76-41008f2b61d2" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('7959dd59-b811-4aaf-b8c1-f84bb154a8e5','266a216b-3129-43ef-8f76-41008f2b61d2')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('7959dd59-b811-4aaf-b8c1-f84bb154a8e5','266a216b-3129-43ef-8f76-41008f2b61d2')">Open In Tab</button></div><div id="6d237786-5616-4825-b006-2ebdab77e323" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
