Skip to content

GroupBy.apply can't yield Series with DataFrame input #131

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
wesm opened this issue Sep 8, 2011 · 2 comments
Closed

GroupBy.apply can't yield Series with DataFrame input #131

wesm opened this issue Sep 8, 2011 · 2 comments
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented Sep 8, 2011

In [23]: import pandas.util.testing as tm

In [24]: df = tm.makeTimeDataFrame()

In [25]: df.groupby(lambda x: x.month).count()
Out[25]: 
   A   B   C   D 
1  21  21  21  21
2  9   9   9   9 


In [26]: df.groupby(lambda x: x.month).apply(len)
Exception

you want to get a Series like:

1  21
2  9
@wesm wesm closed this as completed Sep 9, 2011
@wesm
Copy link
Member Author

wesm commented Sep 9, 2011

@chrisjordansquire check this one out too

@chrisjordansquire
Copy link

Will do. Thanks!

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

No branches or pull requests

2 participants