xarray.DataArray.drop

DataArray.drop(self, labels, dim=None, *, errors='raise')

Drop coordinates or index labels from this DataArray.

Parameters
  • labels (hashable or sequence of hashables) – Name(s) of coordinates or index labels to drop. If dim is not None, labels can be any array-like.

  • dim (hashable, 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

dropped

Return type

DataArray