Skip to content

Commit d093eae

Browse files
committed
Expanded tests, added reference to GHI
1 parent 042d52b commit d093eae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/groupby/test_function.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,15 @@ def test_ops_general(op, targop):
603603
],
604604
)
605605
def test_ops_not_as_index(op):
606+
# GH 10355
607+
# Using as_index=False should not modify grouped column
606608
df = DataFrame(np.random.randint(0, 5, size=(100, 2)), columns=["a", "b"])
609+
expected = getattr(df.groupby("a"), op)().reset_index()
607610

608611
result = getattr(df.groupby("a", as_index=False), op)()
609-
expected = getattr(df.groupby("a"), op)().reset_index()
612+
tm.assert_frame_equal(result, expected)
613+
614+
result = getattr(df.groupby("a", as_index=False)["b"], op)()
610615
tm.assert_frame_equal(result, expected)
611616

612617

0 commit comments

Comments
 (0)