Skip to content

Groupby agg works with pd.Series.nunique, but groupby nunique fails with axis=1 #30311

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

Merged
merged 11 commits into from
Dec 18, 2019
Merged

Conversation

Ynob2000
Copy link
Contributor

@Ynob2000 Ynob2000 commented Dec 17, 2019

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@Ynob2000
Copy link
Contributor Author

PR has been updated accordingly to your remarks

@TomAugspurger TomAugspurger added this to the 1.0 milestone Dec 18, 2019
@WillAyd WillAyd merged commit c96012d into pandas-dev:master Dec 18, 2019
@WillAyd
Copy link
Member

WillAyd commented Dec 18, 2019

Great thanks @nlepleux !

@@ -1813,9 +1813,20 @@ def groupby_series(obj, col=None):
# Try to consolidate with normal wrapping functions
from pandas.core.reshape.concat import concat

results = [groupby_series(content, label) for label, content in obj.items()]
axis_number = obj._get_axis_number(self.axis)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillAyd this is adding quite a bit of very hard and bespoke code

pls don’t merge non trivial things like this

this is also likely non performant

pls revert

@WillAyd
Copy link
Member

WillAyd commented Dec 19, 2019 via email

@jreback
Copy link
Contributor

jreback commented Dec 19, 2019

i am way more concerned about the code smell this introduces
w/o much review

proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
AlexKirko pushed a commit to AlexKirko/pandas that referenced this pull request Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Groupby agg works with pd.Series.nunique, but groupby nunique fails with axis=1
4 participants