# xarray.Dataset.isin

#### Dataset.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('d6fddc2f-da81-4c48-9e52-eff8431c4a83','a5a6d0cd-3020-4085-aab6-2e214ce98a7a','89e6e8ad-20dc-42be-89ce-f4ca49379209','../lite/tree/../notebooks/index.html?path=78c19203_3f97_4af5_ba9a_cd483b10ebd6.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="89e6e8ad-20dc-42be-89ce-f4ca49379209" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d6fddc2f-da81-4c48-9e52-eff8431c4a83','89e6e8ad-20dc-42be-89ce-f4ca49379209')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d6fddc2f-da81-4c48-9e52-eff8431c4a83','89e6e8ad-20dc-42be-89ce-f4ca49379209')">Open In Tab</button></div><div id="a5a6d0cd-3020-4085-aab6-2e214ce98a7a" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
