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

Method _simplify_down

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

setClass · 0.85
indexMethod · 0.45

Tested by

no test coverage detected