# xarray.DataArray.sel

`DataArray.``sel`(indexers: Mapping[Hashable, Any] = None, method: str = None, tolerance=None, drop: bool = False, **indexers_kwargs) → xarray.core.dataarray.DataArray

  Return a new DataArray whose data is given by selecting index labels along the specified dimension(s).

  Warning

  Do not try to assign values when using any of the indexing methods `isel` or `sel`:

      da = xr.DataArray([0, 1, 2, 3], dims=['x'])
      # DO NOT do this
      da.isel(x=[0, 1, 2])[1] = -1

  Assigning values with the chained indexing using `.sel` or `.isel` fails silently.

  See also

  `Dataset.sel()`, `DataArray.isel()`