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

Function _apply_chunk

dask/dataframe/groupby.py:337–349  ·  view source on GitHub ↗
(df, *by, dropna=None, observed=None, **kwargs)

Source from the content-addressed store, hash-verified

335
336
337def _apply_chunk(df, *by, dropna=None, observed=None, **kwargs):
338 func = kwargs.pop("chunk")
339 columns = kwargs.pop("columns")
340 dropna = {"dropna": dropna} if dropna is not None else {}
341 observed = {"observed": observed} if observed is not None else {}
342
343 g = _groupby_raise_unaligned(df, by=by, **observed, **dropna)
344 if is_series_like(df) or columns is None:
345 return func(g, **kwargs)
346 else:
347 if isinstance(columns, (tuple, list, set, pd.Index)):
348 columns = list(columns)
349 return func(g[columns], **kwargs)
350
351
352def _var_chunk(df, *by, numeric_only=no_default, observed=False, dropna=True):

Callers 2

chunkMethod · 0.90
_metaMethod · 0.90

Calls 4

is_series_likeFunction · 0.90
_groupby_raise_unalignedFunction · 0.85
popMethod · 0.80
funcFunction · 0.70

Tested by

no test coverage detected