xarray.groupers.UniqueGrouper#

class xarray.groupers.UniqueGrouper(labels=None)[source]#

Grouper object for grouping by a categorical variable.

Parameters:

labels (array-like, optional) – Group labels to aggregate on. This is required when grouping by a chunked array type (e.g. dask or cubed) since it is used to construct the coordinate on the output. Grouped operations will only be run on the specified group labels. Any group that is not present in labels will be ignored.

__init__(labels=None)[source]#

Methods

__init__([labels])

factorize(group)

Creates intermediates necessary for GroupBy.

reset()

Creates a new version of this Grouper clearing any caches.

Attributes

group_as_index

Caches the group DataArray as a pandas Index.

labels