Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Change Panel.shift arg signature to match generic's #6910

Closed
2 tasks done
TomAugspurger opened this issue Apr 18, 2014 · 0 comments · Fixed by #6928
Closed
2 tasks done

API: Change Panel.shift arg signature to match generic's #6910

TomAugspurger opened this issue Apr 18, 2014 · 0 comments · Fixed by #6928
Labels
API Design Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@TomAugspurger
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants