DEPR: deprecate Series/DataFrame.compound by jorisvandenbossche · Pull Request #26405 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation9 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@jorisvandenbossche

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

@topper-123

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

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

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

Actually, that's expanding no?

@codecov

@codecov

jreback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jorisvandenbossche

@jorisvandenbossche

@jorisvandenbossche

@Davdav05

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

it’s just

(1 + s).prod() - 1

Labels