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

[FEA] DataFrame pct_change #9603

Closed
beckernick opened this issue Nov 4, 2021 · 0 comments · Fixed by #9805
Closed

[FEA] DataFrame pct_change #9603

beckernick opened this issue Nov 4, 2021 · 0 comments · Fixed by #9805
Assignees
Labels
feature request New feature or request good first issue Good for newcomers Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

Series.pct_change was implemented in cuDF Python in #8650 . For pandas compatibility, it would be nice to implement this for DataFrames. The DataFrame method calculates the percent change individually for each column.

As a starting point, it would make sense to limit the supported parameters/configuration currently supported by Series.pct_change.

import pandas as pddf = pd.DataFrame({
    'FR': [4.0405, 4.0963, 4.3149],
    'GR': [1.7246, 1.7482, 1.8519],
    'IT': [804.74, 810.01, 860.13]},
    index=['1980-01-01', '1980-02-01', '1980-03-01'])
​
print(df, "\n")
print(df.pct_change())
                FR      GR      IT
1980-01-01  4.0405  1.7246  804.74
1980-02-01  4.0963  1.7482  810.01
1980-03-01  4.3149  1.8519  860.13 

                  FR        GR        IT
1980-01-01       NaN       NaN       NaN
1980-02-01  0.013810  0.013684  0.006549
1980-03-01  0.053365  0.059318  0.061876
@beckernick beckernick added feature request New feature or request Python Affects Python cuDF API. labels Nov 4, 2021
@beckernick beckernick added the good first issue Good for newcomers label Nov 4, 2021
@skirui-source skirui-source self-assigned this Nov 30, 2021
rapids-bot bot pushed a commit that referenced this issue Feb 17, 2022
Fixes: #9603

Next steps:

- [ ] Fix #10314 
- [ ] Move `diff `and `pct_change` to `indexed_frame`  so that both are accessible to `Series` as well

Authors:
  - Sheilah Kirui (https://github.com/skirui-source)

Approvers:
  - Karthikeyan (https://github.com/karthikeyann)
  - Michael Wang (https://github.com/isVoid)

URL: #9805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants