MCPcopy Index your code
hub / github.com/pydata/xarray / _codes_to_group_indices

Function _codes_to_group_indices

xarray/core/groupby.py:91–98  ·  view source on GitHub ↗

Converts integer codes for groups to group indices.

(codes: np.ndarray, N: int)

Source from the content-addressed store, hash-verified

89
90
91def _codes_to_group_indices(codes: np.ndarray, N: int) -> GroupIndices:
92 """Converts integer codes for groups to group indices."""
93 assert codes.ndim == 1
94 groups: GroupIndices = tuple([] for _ in range(N))
95 for n, g in enumerate(codes):
96 if g >= 0:
97 groups[g].append(n)
98 return groups
99
100
101def _dummy_copy(xarray_obj):

Callers 2

__init__Method · 0.90
factorizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…