Skip to content

Commit 992eaff

Browse files
committed
fix index and Series tests
1 parent bfa5846 commit 992eaff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/groupby/test_groupby_dropna.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,9 @@ def test_groupby_nan_included_warns(by, dropna):
397397
# GH 61339
398398
data = {"group": ["g1", np.nan, "g1", "g2", np.nan], "B": [0, 1, 2, 3, 4]}
399399
df = pd.DataFrame(data)
400-
if by == "_index":
400+
if isinstance(by, str) and by == "_index":
401401
df = df.set_index("group")
402+
by = "group"
402403

403404
kwargs = {}
404405
warning_type = pd.errors.NullKeyWarning

0 commit comments

Comments
 (0)