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

Method _lower

dask/dataframe/dask_expr/_reductions.py:709–727  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

707 return meta
708
709 def _lower(self):
710 args = [
711 self.frame,
712 self.operand("columns"),
713 self.operand("index"),
714 self.operand("values"),
715 ]
716 if self.aggfunc == "sum":
717 return PivotTableSum(*args)
718 elif self.aggfunc == "mean":
719 return PivotTableSum(*args) / PivotTableCount(*args)
720 elif self.aggfunc == "count":
721 return PivotTableCount(*args)
722 elif self.aggfunc == "first":
723 return PivotTableFirst(*args)
724 elif self.aggfunc == "last":
725 return PivotTableLast(*args)
726 else:
727 raise NotImplementedError(f"{self.aggfunc=} is not implemented")
728
729
730class PivotTableAbstract(ApplyConcatApply):

Callers

nothing calls this directly

Calls 5

PivotTableSumClass · 0.85
PivotTableCountClass · 0.85
PivotTableFirstClass · 0.85
PivotTableLastClass · 0.85
operandMethod · 0.80

Tested by

no test coverage detected