# xarray.DataArray.isin

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

Tests 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.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('1cea3209-a727-4745-b6dc-44c8a22ad227','a6363bb1-60fa-463a-9077-8cd28694ee71','c9cdddea-7212-4ca8-8b0d-6d5121c8650b','../lite/tree/../notebooks/index.html?path=1a3fe07e_8ce3_4d94_995d_7bddaa703a6d.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="c9cdddea-7212-4ca8-8b0d-6d5121c8650b" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('1cea3209-a727-4745-b6dc-44c8a22ad227','c9cdddea-7212-4ca8-8b0d-6d5121c8650b')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('1cea3209-a727-4745-b6dc-44c8a22ad227','c9cdddea-7212-4ca8-8b0d-6d5121c8650b')">Open In Tab</button></div><div id="a6363bb1-60fa-463a-9077-8cd28694ee71" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>

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