# xarray.Dataset.isin

#### Dataset.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('bbd40f36-3f15-429c-9403-09611270117f','63053bfa-4a48-47d2-bd43-e5a35a50ac33','a261ba82-c8cd-4da9-bcfb-95fe1f9fefda','../lite/tree/../notebooks/index.html?path=9b63ce13_3ea1_422b_933e_70181ea61c03.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="a261ba82-c8cd-4da9-bcfb-95fe1f9fefda" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('bbd40f36-3f15-429c-9403-09611270117f','a261ba82-c8cd-4da9-bcfb-95fe1f9fefda')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('bbd40f36-3f15-429c-9403-09611270117f','a261ba82-c8cd-4da9-bcfb-95fe1f9fefda')">Open In Tab</button></div><div id="63053bfa-4a48-47d2-bd43-e5a35a50ac33" 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)
