xarray.DataArray.drop

DataArray.drop(labels: Union[Hashable, Sequence[Hashable]], dim: Optional[Hashable] = None, *, errors: str = 'raise') → xarray.core.dataarray.DataArray

Drop coordinates or index labels from this DataArray.

Parameters
labelshashable or sequence of hashables

Name(s) of coordinate variables or index labels to drop.

dimhashable, optional

Dimension along which to drop index labels. By default (if dim is None), drops coordinates rather than index labels.

errors: {‘raise’, ‘ignore’}, optional

If ‘raise’ (default), raises a ValueError error if any of the coordinates or index labels passed are not in the array. If ‘ignore’, any given labels that are in the array are dropped and no error is raised.

Returns
——-
droppedDataArray