Skip to content

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

Closed
@wesm

Description

@wesm
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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions