# xarray.Index.sel

#### Index.sel(labels)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/indexes.py#L292-L316)

Query the index with arbitrary coordinate label indexers.

Implementation is optional but required in order to support label-based
selection. Otherwise it will raise an error when trying to call
[`Dataset.sel()`](xarray.Dataset.sel.html.md#xarray.Dataset.sel) with labels for this index coordinates.

Coordinate label indexers can be of many kinds, e.g., scalar, list,
tuple, array-like, slice, [`Variable`](xarray.Variable.html.md#xarray.Variable), [`DataArray`](xarray.DataArray.html.md#xarray.DataArray), etc.
It is the responsibility of the index to handle those indexers properly.

* **Parameters:**
  **labels** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict)) – A dictionary of coordinate label indexers passed from
  [`Dataset.sel()`](xarray.Dataset.sel.html.md#xarray.Dataset.sel) and where the entries have been filtered
  for the current index.
* **Returns:**
  **sel_results** ([`IndexSelResult`](xarray.IndexSelResult.html.md#xarray.IndexSelResult)) – An index query result object that contains dimension positional indexers.
  It may also contain new indexes, coordinate variables, etc.
