# xarray.IndexVariable.isnull

#### IndexVariable.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('da13e9e9-4ad7-4ae5-b3f3-1f681774f5d4','04115dd6-c5e2-4893-85a5-0215ab1d6e9e','aafe949c-a1b9-40a2-801c-8391dc139717','../lite/tree/../notebooks/index.html?path=24b76a97_8792_4cee_8f32_0c2f3caf2c9a.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="aafe949c-a1b9-40a2-801c-8391dc139717" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('da13e9e9-4ad7-4ae5-b3f3-1f681774f5d4','aafe949c-a1b9-40a2-801c-8391dc139717')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('da13e9e9-4ad7-4ae5-b3f3-1f681774f5d4','aafe949c-a1b9-40a2-801c-8391dc139717')">Open In Tab</button></div><div id="04115dd6-c5e2-4893-85a5-0215ab1d6e9e" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
