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

DEPR: deprecate Series/DataFrame.compound #26405

Merged

Conversation

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented May 15, 2019

xref #18262

Not sure if we need to point to an alternative in the deprecation warning. I can put the exact "formula" for what we are currently calculating, but I don't know enough from finance to know if that is actually good to point to (eg I don't directly see that formula on the first google hit https://en.wikipedia.org/wiki/Compound_interest)

@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone May 15, 2019
@jreback jreback mentioned this pull request May 15, 2019
34 tasks
@topper-123
Copy link
Contributor

@topper-123 topper-123 commented May 15, 2019

I'm +1 on deprecating this, as a scalar verion of compount is not particularly useful (I'm an economist).

But also, compound interests arrays can be a bit tricky to calulate in some cases. Would there be acceptance for adding e.g. cumpct_change to mirror cumsum etc.?

@jorisvandenbossche
Copy link
Member Author

@jorisvandenbossche jorisvandenbossche commented May 15, 2019

Thanks, good to have feedback of somebody who knows something about it! :)

Would there be acceptance for adding e.g. cumpct_change to mirror cumsum etc.?

Personally, I would say, that looks a a bit too specific (but yeah, I would never use it myself). Maybe we should think about making it easier to do generic cumulative operations.

@jorisvandenbossche
Copy link
Member Author

@jorisvandenbossche jorisvandenbossche commented May 15, 2019

Maybe we should think about making it easier to do generic cumulative operations.

Actually, that's expanding no?

@codecov
Copy link

@codecov codecov bot commented May 15, 2019

Codecov Report

Merging #26405 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26405      +/-   ##
==========================================
+ Coverage   91.69%   91.69%   +<.01%     
==========================================
  Files         174      174              
  Lines       50743    50745       +2     
==========================================
+ Hits        46527    46529       +2     
  Misses       4216     4216
Flag Coverage Δ
#multiple 90.2% <100%> (ø) ⬆️
#single 41.19% <0%> (-0.14%) ⬇️
Impacted Files Coverage Δ
pandas/core/generic.py 93.49% <100%> (+0.14%) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97.02% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.7% <0%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b24fb6...9a3ac10. Read the comment docs.

@codecov
Copy link

@codecov codecov bot commented May 15, 2019

Codecov Report

Merging #26405 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26405      +/-   ##
==========================================
- Coverage   91.69%   91.68%   -0.01%     
==========================================
  Files         174      174              
  Lines       50739    50741       +2     
==========================================
+ Hits        46523    46524       +1     
- Misses       4216     4217       +1
Flag Coverage Δ
#multiple 90.19% <100%> (ø) ⬆️
#single 41.16% <0%> (-0.16%) ⬇️
Impacted Files Coverage Δ
pandas/core/generic.py 93.49% <100%> (+0.14%) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97.02% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c5165e...4d40284. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

lgtm. can you add a whats new note & add to the deprecated issue tracker

@jorisvandenbossche
Copy link
Member Author

@jorisvandenbossche jorisvandenbossche commented May 16, 2019

Added whatsnew

@jorisvandenbossche jorisvandenbossche merged commit 421ae9d into pandas-dev:master May 16, 2019
11 checks passed
@jorisvandenbossche jorisvandenbossche deleted the depr-compound branch May 16, 2019
@Davdav05
Copy link

@Davdav05 Davdav05 commented Nov 20, 2019

Hey guys, as you mentioned there is no alternative suggested. I've been using this method for a while, what would be the shortest/cleanest way to replace this method on a Series?

Thanks!

@jreback
Copy link
Contributor

@jreback jreback commented Nov 21, 2019

it’s just

(1 + s).prod() - 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants