Skip to content
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

DataFrame.groupby.count sometimes returns Series instead of DataFrame #3596

Closed
elliottwaldron opened this issue May 13, 2013 · 3 comments

Comments

@elliottwaldron
Copy link

commented May 13, 2013

In version 0.11.0

A = DataFrame([[1,1],[2,1]],columns=['X','Y']).groupby('X').count()

returns a DataFrame, when there are 2+ grouping levels...

but,

B = DataFrame([[1,1],[1,1]],columns=['X','Y']).groupby('X').count()

returns a Series, when there is only 1 grouping level.

In version 0.10.0, B would also be a DataFrame.

Don't know if this was by design, but it seems awkward to check the type before using B downstream.

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 13, 2013

#2893 changed this

maybe we should add a keyword to make this optional instead of sometimes changing the arity

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 13, 2013

@wesm ?

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 15, 2013

closeed by #3599

@jreback jreback closed this May 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.