# xarray.DataArray.isin

#### DataArray.isin(test_elements)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/common.py#L1376-L1426)

Test each value in the array for whether it is in test elements.

* **Parameters:**
  **test_elements** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like) or `set_like`) – The values against which to test each value of element.
  This argument is flattened if an array or array_like.
  See numpy notes for behavior with non-array-like parameters.
* **Returns:**
  **isin** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray) or [`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – Has the same type and shape as this object, but with a bool dtype.

#### SEE ALSO
[`numpy.isin`](https://numpy.org/doc/stable/reference/generated/numpy.isin.html#numpy.isin)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('17e8e28c-cb30-4339-a345-4a34284d9d7d','43690fb6-5b8e-4c34-a668-614bb6184843','e8fdf6b4-3c2e-4103-a3dd-bf0a673bd428','../lite/tree/../notebooks/index.html?path=59901508_0fa9_4628_98de_a983a63a1f6d.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> array = xr.DataArray([1, 2, 3], dims="x")
>>> array.isin([1, 3])
<xarray.DataArray (x: 3)> Size: 3B
array([ True, False,  True])
Dimensions without coordinates: x
```

<div id="e8fdf6b4-3c2e-4103-a3dd-bf0a673bd428" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('17e8e28c-cb30-4339-a345-4a34284d9d7d','e8fdf6b4-3c2e-4103-a3dd-bf0a673bd428')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('17e8e28c-cb30-4339-a345-4a34284d9d7d','e8fdf6b4-3c2e-4103-a3dd-bf0a673bd428')">Open In Tab</button></div><div id="43690fb6-5b8e-4c34-a668-614bb6184843" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
