Skip to content

BUG DataFrameGroupBy.agg with list not respecting as_index=False #53237

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 12 commits into from
May 22, 2023

Conversation

Charlie-XIAO
Copy link
Contributor

@Charlie-XIAO Charlie-XIAO commented May 15, 2023

Dealing with non-categorical data is fairly easy, but dealing with categorical data is kind of tricky. I'm currently taking a pretty dirty approach, so if maintainers have better solutions please let me know and I'll make changes correspondingly.

@mroeschke mroeschke requested a review from rhshadrach May 15, 2023 18:18
@mroeschke mroeschke added Groupby Apply Apply, Aggregate, Transform, Map labels May 15, 2023
@rhshadrach rhshadrach added the Bug label May 18, 2023
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Can you add tests for this other than categorical in tests/groupby/aggregate/test_aggregate.py

@Charlie-XIAO
Copy link
Contributor Author

@rhshadrach Thanks for your review! New test added and I've made your suggested modification.

@rhshadrach rhshadrach added this to the 2.1 milestone May 20, 2023
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@mroeschke mroeschke merged commit 64c1e5e into pandas-dev:main May 22, 2023
@mroeschke
Copy link
Member

Thanks @Charlie-XIAO

topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 22, 2023
…andas-dev#53237)

* fix dataframegroupby.agg not respecting as_index=false

* cleaned up code, removed breakpoints

* cleaning up codes

* final cleanup of code, ready for review, sry abt that

* resolve typing (not sure)

* used better approach

* new test added; enh short circuiting

* clean up code
@Charlie-XIAO Charlie-XIAO deleted the grpby-agg-asindex branch June 28, 2023 05:42
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
…andas-dev#53237)

* fix dataframegroupby.agg not respecting as_index=false

* cleaned up code, removed breakpoints

* cleaning up codes

* final cleanup of code, ready for review, sry abt that

* resolve typing (not sure)

* used better approach

* new test added; enh short circuiting

* clean up code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Bug Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrameGroupBy.agg with lists doesn't respect as_index=False
3 participants