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

Method _simplify_down

dask/dataframe/dask_expr/_groupby.py:597–615  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

595 groupby_aggregate = M.sum
596
597 def _simplify_down(self):
598 if (
599 self._slice is not None
600 and not isinstance(self._slice, list)
601 or self.frame.ndim == 1
602 ):
603 # Scalar slices influence the result and are allowed, i.e., the name of
604 # the series is different
605 return
606
607 # We can remove every column since pandas reduces to a Series anyway
608 by_columns = self._by_columns
609 by_columns = [c for c in by_columns if c in self.frame.columns]
610 if set(by_columns) == set(self.frame.columns):
611 return
612
613 slice_idx = self._parameters.index("_slice")
614 ops = [op if i != slice_idx else None for i, op in enumerate(self.operands)]
615 return type(self)(self.frame[by_columns], *ops[1:])
616
617
618class IdxMin(SingleAggregation):

Callers

nothing calls this directly

Calls 2

setClass · 0.85
indexMethod · 0.45

Tested by

no test coverage detected