-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix droped result column in groupby with as_index False #33247
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
BUG: Fix droped result column in groupby with as_index False #33247
Conversation
One comment otherwise LGTM |
Done @mroeschke |
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
Merge conflict in whats new. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good a couple of comments
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
Looks good. Looks like there are some failing code checks |
Missed that one, is green now. |
let's rebase this on top of #34012 (or could wait, likey to merge that one tomorrow). this migth be fine but will want to re-look. |
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
@jreback Merged master after the other pull request was merged. Seems to be fine. |
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
� Conflicts: � doc/source/whatsnew/v1.1.0.rst � pandas/tests/groupby/aggregate/test_aggregate.py
@jreback merged master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some doc comments, looks good otherwise.
@jreback Changed the docs, test failure seems unrelated |
looks good, can you rebase to fix the conflict (the other fail is ok), ping when ready. |
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
@jreback fixed conflict, failure unrelated. Can be merged |
can you merge master and ping when green |
@phofl if you can merge master will have another look |
Sorry, was a Bit busy the last few days. Will merge master tomorrow and ping when ready |
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
thanks @phofl |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
The aggregate function lost the results of the aggregate operation, if the
as_index=False
flag was set and one of the result columns is relabeled. The index was reset at first, adding columns to the DataFrame. The relabeling operation only took the columns before resetting the index as input. So the weird error occurred. I changed the order of the index reset and the relabeling. This fixes the issue.