Skip to content

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

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
lminer opened this issue Mar 29, 2016 · 1 comment
Closed

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

lminer opened this issue Mar 29, 2016 · 1 comment
Labels
Enhancement Groupby Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@lminer
Copy link

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
Copy link
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 Allow .expanding() to be called on groupby object Allow .expanding() to be called on groupby object Mar 30, 2016
@jreback jreback added Enhancement Groupby Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels 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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Groupby Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants