# xarray.DataArray.isnull

#### DataArray.isnull(keep_attrs=None)[[source]](https://github.com/pydata/xarray/blob/v2026.09.0/xarray/core/common.py#L1275-L1316)

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

* **Parameters:**
  **keep_attrs** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True, the attributes (attrs) will be copied from
  the original object to the new one. If False, the new
  object will be returned without attributes.
* **Returns:**
  **isnull** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray) or [`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – 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('b231bc1c-54ca-473d-b9d2-eedede179760','f6f2b093-242e-4c53-9925-7cf622823e9e','56256d44-b068-49f5-96fe-6ff3df841d27','../lite/tree/../notebooks/index.html?path=d2cc6cf7_3b80_484c_80d7_d51cc57e1673.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> array = xr.DataArray([1, np.nan, 3], dims="x")
>>> array
<xarray.DataArray (x: 3)> Size: 24B
array([ 1., nan,  3.])
Dimensions without coordinates: x
>>> array.isnull()
<xarray.DataArray (x: 3)> Size: 3B
array([False,  True, False])
Dimensions without coordinates: x
```

<div id="56256d44-b068-49f5-96fe-6ff3df841d27" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('b231bc1c-54ca-473d-b9d2-eedede179760','56256d44-b068-49f5-96fe-6ff3df841d27')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('b231bc1c-54ca-473d-b9d2-eedede179760','56256d44-b068-49f5-96fe-6ff3df841d27')">Open In Tab</button></div><div id="f6f2b093-242e-4c53-9925-7cf622823e9e" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
