# xarray.IndexVariable.isnull

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

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('195a8d1d-6f3d-472c-b5dc-dde992e49439','9ee0e2c5-dd5e-4d3f-9cb8-f0dcbbfed689','95276a69-94d0-4cf3-9ab3-f7328f53d486','../lite/tree/../notebooks/index.html?path=0dba26dc_0e82_4df0_992b_f84049290abe.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="95276a69-94d0-4cf3-9ab3-f7328f53d486" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('195a8d1d-6f3d-472c-b5dc-dde992e49439','95276a69-94d0-4cf3-9ab3-f7328f53d486')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('195a8d1d-6f3d-472c-b5dc-dde992e49439','95276a69-94d0-4cf3-9ab3-f7328f53d486')">Open In Tab</button></div><div id="9ee0e2c5-dd5e-4d3f-9cb8-f0dcbbfed689" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
