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

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


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.