diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 2e2ae4e1dfa0a2..046a9082e942e4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10226,7 +10226,7 @@ def compound(self, axis=None, skipna=None, level=None): name2, axis_descr, "minimum", - lambda y, axis: np.minimum.accumulate(y, axis), + np.minimum.accumulate, "min", np.inf, np.nan, @@ -10239,7 +10239,7 @@ def compound(self, axis=None, skipna=None, level=None): name2, axis_descr, "sum", - lambda y, axis: y.cumsum(axis), + np.cumsum, "sum", 0.0, np.nan, @@ -10252,7 +10252,7 @@ def compound(self, axis=None, skipna=None, level=None): name2, axis_descr, "product", - lambda y, axis: y.cumprod(axis), + np.cumprod, "prod", 1.0, np.nan, @@ -10265,7 +10265,7 @@ def compound(self, axis=None, skipna=None, level=None): name2, axis_descr, "maximum", - lambda y, axis: np.maximum.accumulate(y, axis), + np.maximum.accumulate, "max", -np.inf, np.nan,