MCPcopy
hub / github.com/pydata/xarray / groups

Method groups

xarray/core/groupby.py:823–836  ·  view source on GitHub ↗

Mapping from group labels to indices. The indices can be used to index the underlying object.

(self)

Source from the content-addressed store, hash-verified

821
822 @property
823 def groups(self) -> dict[GroupKey, GroupIndex]:
824 """
825 Mapping from group labels to indices. The indices can be used to index the underlying object.
826 """
827 # provided to mimic pandas.groupby
828 if self._groups is None:
829 self._groups = dict(
830 zip(
831 self.encoded.unique_coord.data,
832 tuple(g for g in self.encoded.group_indices if g),
833 strict=True,
834 )
835 )
836 return self._groups
837
838 def __getitem__(self, key: GroupKey) -> T_Xarray:
839 """

Callers 5

_ensure_padded_yearFunction · 0.45
_get_res_multiMethod · 0.45
open_groups_as_dictMethod · 0.45
_iter_zarr_groupsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected