MCPcopy Create free account
hub / github.com/dask/dask / _groupby_slice_shift

Function _groupby_slice_shift

dask/dataframe/groupby.py:151–172  ·  view source on GitHub ↗
(
    df,
    grouper,
    key,
    shuffled,
    group_keys=GROUP_KEYS_DEFAULT,
    dropna=None,
    observed=None,
    **kwargs,
)

Source from the content-addressed store, hash-verified

149
150
151def _groupby_slice_shift(
152 df,
153 grouper,
154 key,
155 shuffled,
156 group_keys=GROUP_KEYS_DEFAULT,
157 dropna=None,
158 observed=None,
159 **kwargs,
160):
161 # No need to use raise if unaligned here - this is only called after
162 # shuffling, which makes everything aligned already
163 dropna = {"dropna": dropna} if dropna is not None else {}
164 observed = {"observed": observed} if observed is not None else {}
165 if shuffled:
166 df = df.sort_index()
167 g = df.groupby(grouper, group_keys=group_keys, **observed, **dropna)
168 if key:
169 g = g[key]
170 with check_groupby_axis_deprecation():
171 result = g.shift(**kwargs)
172 return result
173
174
175def _groupby_get_group(df, by_key, get_key, columns):

Callers 1

groupby_slice_shiftFunction · 0.90

Calls 3

groupbyMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected