Skip to content

Specify that both by and level should not be specified in groupby - GH40378 #47825

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 1 commit into from
Aug 8, 2022

Conversation

GivyBoy
Copy link
Contributor

@GivyBoy GivyBoy commented Jul 22, 2022

Ref: #47778 (comment)

@GivyBoy GivyBoy marked this pull request as ready for review July 22, 2022 19:55
@mroeschke
Copy link
Member

Thanks for the pull request, but I believe this was addressed by #47778?

Also, please fill out the pull request template to give more context to reviewers. Thanks.

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.

The docs change looks good. As mentioned in #40378 (comment), I think we should also be raising an error when both by and level are specified. If you'd like to address that here, I'd be +1. Not doing so is also okay - we can have it addressed in a separate PR.

@rhshadrach
Copy link
Member

rhshadrach commented Jul 23, 2022

@mroeschke: #47778 (comment)

@GivyBoy: When doing a PR that is following up from a conversation, it's helpful for reviews today as well as developers way in the future to reference it in the OP. So I would recommend adding here:

Ref: #47778 (comment)

@mroeschke mroeschke added Docs and removed Closing Candidate May be closeable, needs more eyeballs labels Jul 23, 2022
@rhshadrach
Copy link
Member

@GivyBoy - I think this looks good; can you merge main and resolve conflicts.

@GivyBoy GivyBoy requested a review from rhshadrach July 29, 2022 15:23
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.

It looks like the merge restored the line

The argument validation should be done in ``.groupby()``, using the name of the specific index.

This is the one that should be removed.

@GivyBoy GivyBoy force-pushed the GH40378 branch 3 times, most recently from 10debf4 to b4b0f39 Compare July 31, 2022 17:08
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.

In the user guide we're losing the sentence

When using .groupby() on a DatFrame with a MultiIndex, do not specify both by and level.

But I think that's okay (API docs seems sufficient to me). @mroeschke - thoughts?

@mroeschke
Copy link
Member

In the user guide we're losing the sentence

When using .groupby() on a DatFrame with a MultiIndex, do not specify both by and level.

But I think that's okay (API docs seems sufficient to me). @mroeschke - thoughts?

Yeah I think that's fine. Generally I favor things in the API docs over the user guide as I'm guessing the API docs get more visibility.

@mroeschke mroeschke added this to the 1.5 milestone Aug 8, 2022
@mroeschke mroeschke merged commit 753d0ed into pandas-dev:main Aug 8, 2022
@mroeschke
Copy link
Member

Thanks @GivyBoy

noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…roupby`` - GH40378 (pandas-dev#47825)

Added that ``level`` and ``by`` should not be specified when using the ``groupby`` function (pandas-dev#40378)
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.

BUG: TypeError when trying to group on column name and index level at the same time
3 participants