GroupBy.apply can't yield Series with DataFrame input (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Sign in

Sign up

Appearance settings

pandas-dev / pandas Public

Additional navigation options

New issue

New issue

Closed

Closed

GroupBy.apply can't yield Series with DataFrame input

#131

Labels

Bug

Milestone

0.4.0

@wesm

Description

@wesm

wesm

opened

on 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

Metadata

Metadata

Assignees

No one assigned

Labels

Bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions