Skip to content

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

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

Closed
wants to merge 28 commits into from
Closed
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8c5fed9
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
25ddc0c
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
8ac46b7
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
28cb2bb
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
22241da
Merge https://github.com/GivyBoy/pandas-ag into first-proj
GivyBoy Jul 12, 2022
477bde6
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
1b39a25
updated the docstring in accordance with GH40378
GivyBoy Jul 12, 2022
53b122d
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
5e758c5
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
46af753
Revert "updated the docstring in accordance with GH40378"
GivyBoy Jul 13, 2022
cd1a30b
Revert "updated the docstring in accordance with GH40378"
GivyBoy Jul 13, 2022
a9c931b
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
7373884
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
56a6712
Merge branch 'pandas-dev:main' into main
GivyBoy Jul 13, 2022
30b1acf
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
6c3c46a
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
2f1b541
Merge branch 'pandas-dev:main' into main
GivyBoy Jul 13, 2022
ece2955
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
f5c0238
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
84c1136
updated the docstring in accordance with GH40378
GivyBoy Jul 13, 2022
992e0fd
Merge branch 'proj'
GivyBoy Jul 13, 2022
3be2d93
Merge branch 'main' of https://github.com/GivyBoy/pandas-ag
GivyBoy Jul 13, 2022
ffec05c
updated the docstring in accordance with GH40378
GivyBoy Jul 14, 2022
7d1ebda
updated the docstring in accordance with GH40378
GivyBoy Jul 14, 2022
f4c1944
updated the docstring in accordance with GH40378
GivyBoy Jul 14, 2022
5e1e142
updated the docstring in accordance with GH40378
GivyBoy Jul 14, 2022
5119a16
updated the docstring in accordance with GH40378
GivyBoy Jul 14, 2022
02d6e90
updated the docstring in accordance with GH40378
GivyBoy Jul 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8332,6 +8332,19 @@ def update(
1 Falcon 370.0
2 Parrot 24.0
3 Parrot 26.0

When using ``.groupby()`` on a multiple index dataframe,
do not specify both ``by`` and ``level``.
The argument validation should be done in instead be done in
``.groupby()``, using the name of the specific index.

>>> df = pandas.DataFrame({"col1": ["a", "b", "c"]})

>>> df.index = pandas.MultiIndex.from_arrays([["a", "a", "b"],
... [1, 2, 1]],
... names=["x", "y"])
>>> df.groupby(["col1", "x"]) # Fine
>>> df.groupby("col1", level=0) # TypeError
"""
)
@Appender(_shared_docs["groupby"] % _shared_doc_kwargs)
Expand Down