# xarray.groupers.EncodedGroups

### *class* xarray.groupers.EncodedGroups(codes, full_index, group_indices=None, unique_coord=None, coords=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/groupers.py#L77-L150)

Dataclass for storing intermediate values for GroupBy operation.
Returned by the `factorize` method on Grouper objects.

#### codes

Same shape as the DataArray to group by. Values consist of a unique integer code for each group.

* **Type:**
  [`DataArray`](xarray.DataArray.html.md#xarray.DataArray)

#### full_index

Pandas Index for the group coordinate containing unique group labels.
This can differ from `unique_coord` in the case of resampling and binning,
where certain groups in the output need not be present in the input.

* **Type:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)

#### group_indices

List of indices of array elements belonging to each group. Inferred if not provided.

* **Type:**
  [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple) of [`int`](https://docs.python.org/3/builtins/functions.html#int) or [`slice`](https://docs.python.org/3/builtins/functions.html#slice) or [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*

#### unique_coord

Unique group values present in dataset. Inferred if not provided

* **Type:**
  [`Variable`](xarray.Variable.html.md#xarray.Variable), *optional*

#### \_\_init_\_(codes, full_index, group_indices=None, unique_coord=None, coords=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/groupers.py#L103-L150)

### Methods

| [`__init__`](#xarray.groupers.EncodedGroups.__init__)(codes, full_index[, group_indices, ...])   |    |
|------------------------------------------------------------------------------------------------------|----|

### Attributes

| [`codes`](#xarray.groupers.EncodedGroups.codes)         |    |
|----------------------------------------------------------------|----|
| [`full_index`](#xarray.groupers.EncodedGroups.full_index)    |    |
| [`group_indices`](#xarray.groupers.EncodedGroups.group_indices) |    |
| [`unique_coord`](#xarray.groupers.EncodedGroups.unique_coord)  |    |
| `coords`                                                       |    |
