Skip to content

Commit 8457147

Browse files
author
Kei
committed
Update expected result based on test params instead of result obj
1 parent 062031e commit 8457147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/tests/groupby/methods/test_value_counts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def test_against_frame_and_seriesgroupby(
329329
else:
330330
name = "proportion" if normalize else "count"
331331
expected = expected.reset_index().rename({0: name}, axis=1)
332-
if "level_0" in result:
332+
if groupby in ["array", "function"] and (not as_index and frame):
333333
expected.insert(loc=0, column="level_0", value=result["level_0"])
334334
else:
335335
expected.insert(loc=0, column="country", value=result["country"])

0 commit comments

Comments
 (0)