Skip to content

BUG: groupby.apply incorrectly dropping nan #43236

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
Sep 6, 2021

Conversation

debnathshoham
Copy link
Member

@debnathshoham debnathshoham changed the title BUG: groupby.agg dropping incorrectly dropping nan BUG: groupby.apply dropping incorrectly dropping nan Aug 26, 2021
@debnathshoham debnathshoham changed the title BUG: groupby.apply dropping incorrectly dropping nan BUG: groupby.apply incorrectly dropping nan Aug 26, 2021
@debnathshoham
Copy link
Member Author

since this is a regression, shouldn't this go to 1.3.3?

@jreback jreback added this to the 1.3.3 milestone Sep 4, 2021
@jreback jreback added Groupby Regression Functionality that used to work in a prior pandas version labels Sep 4, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

this looks fine
cc @rhshadrach

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.

Thanks for the PR - looks great.



@pytest.mark.parametrize("dropna", [True, False])
def test_apply_dropna_with_indexed_same2(dropna):
Copy link
Member

Choose a reason for hiding this comment

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

This test completely supersedes the other test_apply_dropna_with_indexed test; can you just apply the parametrization and the expected change to that test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Amended.
Let me know how this looks.

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

@jreback jreback merged commit 9964022 into pandas-dev:master Sep 6, 2021
@jreback
Copy link
Contributor

jreback commented Sep 6, 2021

thanks @debnathshoham

@lumberbot-app
Copy link

lumberbot-app bot commented Sep 6, 2021

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 1.3.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 99640224fbe3ec14b8775492471d5d915093bfba
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #43236: BUG: groupby.apply incorrectly dropping nan'
  1. Push to a named branch :
git push YOURFORK 1.3.x:auto-backport-of-pr-43236-on-1.3.x
  1. Create a PR against branch 1.3.x, I would have named this PR:

"Backport PR #43236 on branch 1.3.x (BUG: groupby.apply incorrectly dropping nan)"

And apply the correct labels and milestones.

Congratulation you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove Still Needs Manual Backport label once the PR gets merged.

If these instruction are inaccurate, feel free to suggest an improvement.

@jreback
Copy link
Contributor

jreback commented Sep 6, 2021

@meeseeksdev backport 1.3.x

@lumberbot-app
Copy link

lumberbot-app bot commented Sep 6, 2021

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 1.3.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 99640224fbe3ec14b8775492471d5d915093bfba
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #43236: BUG: groupby.apply incorrectly dropping nan'
  1. Push to a named branch :
git push YOURFORK 1.3.x:auto-backport-of-pr-43236-on-1.3.x
  1. Create a PR against branch 1.3.x, I would have named this PR:

"Backport PR #43236 on branch 1.3.x (BUG: groupby.apply incorrectly dropping nan)"

And apply the correct labels and milestones.

Congratulation you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove Still Needs Manual Backport label once the PR gets merged.

If these instruction are inaccurate, feel free to suggest an improvement.

@jreback
Copy link
Contributor

jreback commented Sep 6, 2021

@debnathshoham if you can follow the instructions above and manually backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combination of groupby with dropna set to True and apply function not returning expected output
6 participants