Skip to content

Commit 79e203e

Browse files
authored
BUG: Prevent pd.Series.groupby from showing FutureWarning (#60894)
Call is_in_obj only when obj is a DataFrame at get_grouper()
1 parent 36ae10d commit 79e203e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/groupby/grouper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ def is_in_obj(gpr) -> bool:
10231023
return False
10241024

10251025
for gpr, level in zip(keys, levels):
1026-
if is_in_obj(gpr): # df.groupby(df['name'])
1026+
if isinstance(obj, DataFrame) and is_in_obj(gpr): # df.groupby(df['name'])
10271027
in_axis = True
10281028
exclusions.add(gpr.name)
10291029

0 commit comments

Comments
 (0)