Skip to content

BUG: fix valueError for groupby with empty inputs when sample method is called #48484

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 5 commits into from
Sep 12, 2022

Conversation

ntachukwu
Copy link
Contributor

@ntachukwu ntachukwu commented Sep 9, 2022

@mroeschke
Copy link
Member

Looks pretty good. Could use a whatsnew note in 1.6.0.rst under the groupby section.

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.

Looks good, small request

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.

Forgot to submit the request.

Comment on lines 148 to 149
result = DataFrame({"a": [], "b": []})
expected = result.groupby("a").sample()
Copy link
Member

Choose a reason for hiding this comment

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

nit: result should be the result that is being tested, expected should be what we expect. Can you switch these?

@rhshadrach rhshadrach added this to the 1.6 milestone Sep 10, 2022
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 122cd07 into pandas-dev:main Sep 12, 2022
@mroeschke
Copy link
Member

Thanks @Th3nn3ss

@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…is called (pandas-dev#48484)

* fix valueError for empty inputs for groupby sample

* add to whatsnew/v1.6.0.rst  doc

* refactor test for groupby sample

* fix duplicate assert in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants