Skip to content

Panel pct_change bug #6904

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

Closed
shura-v opened this issue Apr 17, 2014 · 3 comments · Fixed by #6909
Closed

Panel pct_change bug #6904

shura-v opened this issue Apr 17, 2014 · 3 comments · Fixed by #6909
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff API Design Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@shura-v
Copy link

shura-v commented Apr 17, 2014

  File "z:\code\m.py", line 420, in get_panel
    self.source_panel.pct_change()
  File "c:\anaconda\lib\site-packages\pandas\core\generic.py", line 3418, in pct_change
    rs = data / data.shift(periods=periods, freq=freq, **kwds) - 1
TypeError: shift() got an unexpected keyword argument 'periods'

pandas.version.version
Out[5]: '0.13.1'

@TomAugspurger
Copy link
Contributor

Thanks for the report. This is a bug.

DataFrame.shift's args are periods=1, freq=None, axis=0, **kwds and Panel's are lags, freq=None, axis='major'.

@jreback I can fix this in common.pct_change by passing periods as a positional arg instead of kwarg. Should I also put a deprecation warning on Panel.shift about changing the lag keyword to periods to be consistent with DataFrame?

@jreback
Copy link
Contributor

jreback commented Apr 17, 2014

hmm this in master?

ok tom sounds good (depr on change ok)
put the ref in the master depr issue (for 0.16)

@TomAugspurger
Copy link
Contributor

Actually not that simple. This should be double, but I'll have to adjust the implementation a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff API Design Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants