xarray.DataArray.drop_duplicates#

DataArray.drop_duplicates(dim, keep='first')[source]#

Returns a new DataArray with duplicate dimension values removed.

Parameters
  • dim (dimension label or labels) – Pass to drop duplicates along all dimensions.

  • keep ({"first", "last", False}, default: "first") – Determines which duplicates (if any) to keep. - "first" : Drop duplicates except for the first occurrence. - "last" : Drop duplicates except for the last occurrence. - False : Drop all duplicates.

Returns

DataArray