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

Handle as_index in GroupBy.apply #13951

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

brandon-b-miller
Copy link
Contributor

Closes #13897

@brandon-b-miller brandon-b-miller added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change labels Aug 24, 2023
@brandon-b-miller brandon-b-miller requested a review from a team as a code owner August 24, 2023 23:52
@brandon-b-miller brandon-b-miller self-assigned this Aug 24, 2023
Comment on lines +1440 to +1441
result = result.reset_index()
result[None] = result.pop(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
result = result.reset_index()
result[None] = result.pop(0)
result = result.reset_index(drop=True)

Could we do this instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I try that, I get a Series still. We're trying to end up with a DataFrame with a column named None:

0    1.0
1    2.5
dtype: float64

vs

   y  None
0  0   1.0
1  1   2.5

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, got it 👍 Then this change LGTM

@brandon-b-miller
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 80d9b1a into rapidsai:branch-23.10 Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Groupby-apply ignores as_index= argument
2 participants