diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 0ca839d51bfe7..285c5786b532b 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -3901,6 +3901,13 @@ def _apply_to_column_groupbys(self, func): """ return a pass thru """ return func(self) + def pct_change(self, periods=1, fill_method='pad', limit=None, freq=None): + """Calculate percent change of each value to previous entry in group""" + filled = getattr(self, fill_method)(limit=limit) + shifted = filled.shift(periods=periods, freq=freq) + + return (filled / shifted) - 1 + class NDFrameGroupBy(GroupBy):