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

Allow .expanding() to be called on groupby object #12738

Closed
lminer opened this Issue Mar 29, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@lminer

lminer commented Mar 29, 2016

Right now when I want to have expanding operate at the level of a group I have to apply a convenience function like so:

def expanding_sum(s):
    return s.expanding().sum()

expanded_sum = df.groupby('mygroup')['mynum'].apply(expanding_sum)

Would be nice to be able to call a method directly on a groupby object:

expanded_sum = df.groupby('mygroup')['mynum'].expanding().sum()
@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Mar 29, 2016

Contributor

related to #12486

yes this should be possible - have to manage the dispatching correctly

Contributor

jreback commented Mar 29, 2016

related to #12486

yes this should be possible - have to manage the dispatching correctly

@jreback jreback changed the title from Allow `.expanding()` to be called on groupby object to Allow .expanding() to be called on groupby object Mar 30, 2016

@jreback jreback added this to the 0.18.1 milestone Mar 30, 2016

jreback added a commit to jreback/pandas that referenced this issue Apr 21, 2016

ENH: allow .rolling / .expanding as groupby methods
closes pandas-dev#12738

BUG: allow df.groupby(...).resample(...) to return a Resampler groupby object

closes pandas-dev#12486

BUG: consistency of name of returned groupby

closes pandas-dev#12363

@jreback jreback closed this in 6994240 Apr 26, 2016

nps added a commit to nps/pandas that referenced this issue May 17, 2016

ENH: allow .rolling / .expanding as groupby methods
closes pandas-dev#12738
closes pandas-dev#12486
closes pandas-dev#12363

Author: Jeff Reback <jeff@reback.net>

Closes pandas-dev#12743 from jreback/expand and squashes the following commits:

f98e6f8 [Jeff Reback] ENH: allow .rolling / .expanding as groupby methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment