API: Change Panel.shift arg signature to match generic's · Issue #6910 · pandas-dev/pandas (original) (raw)
This surfaced in the Panel pct_change
implementation at #6909
generic
: def shift(self, periods=1, freq=None, axis=0, **kwds):
Panel
: def shift(self, lags, freq=None, axis='major'):
I had to adjust the call to shift
in generic.pct_change
to not use a kwarg for lag
/period
:
Before: rs = data / data.shift(periods=periods, freq=freq, **kwds) - 1
After: rs = data.div(data.shift(periods, freq=freq, **kwds)) - 1
We'll need to keep the .div
change, but we can change back the kwarg once the signatures are aligned.
- Add kwarg deprecation decorator
- change
pct_change
back to kwarg