Skip to content

TST: Test groupby method drop na #50755

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 4 commits into from
Jan 17, 2023

Conversation

luke396
Copy link
Contributor

@luke396 luke396 commented Jan 15, 2023

referred to TST: Added test for groupby dropping NA when grouping by columns from pbhoopala

df = DataFrame({"A": ["a", np.nan, "b", np.nan, "c"], "B": range(5)})

if method == "nth":
result = df.groupby("A").agg(method, n=0)
Copy link
Member

Choose a reason for hiding this comment

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

Could you call the actual methods instead of using agg?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, how about this time?

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Groupby labels Jan 16, 2023
@mroeschke mroeschke added this to the 2.0 milestone Jan 17, 2023
@mroeschke mroeschke merged commit 86cb950 into pandas-dev:main Jan 17, 2023
@mroeschke
Copy link
Member

Thanks @luke396

@luke396 luke396 deleted the test-groupby-method-dropna branch January 18, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some groupby methods keep null grouping keys
3 participants