# 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('eb4348bf-5cb9-4ee6-b30b-cd1042e3a612','97162987-3ec8-428a-b167-90d4bd00a938','cb96135e-d6e6-4696-8529-d35a99e5d7cc','../lite/tree/../notebooks/index.html?path=f8914770_73ca_41d6_9f72_d3c45721c84f.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="cb96135e-d6e6-4696-8529-d35a99e5d7cc" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('eb4348bf-5cb9-4ee6-b30b-cd1042e3a612','cb96135e-d6e6-4696-8529-d35a99e5d7cc')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('eb4348bf-5cb9-4ee6-b30b-cd1042e3a612','cb96135e-d6e6-4696-8529-d35a99e5d7cc')">Open In Tab</button></div><div id="97162987-3ec8-428a-b167-90d4bd00a938" 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)
