Skip to content

Commit 787d9ba

Browse files
committed
TST: explicitly constructed expected DataFrame (pandas-dev#7002)
1 parent 0bd567c commit 787d9ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/tests/groupby/test_apply.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,14 @@ def test_apply_function_with_indexing_return_column():
968968
df = DataFrame(
969969
{
970970
"foo1": ["one", "two", "two", "three", "one", "two"],
971-
"foo2": [1, 2, 3, 4, 5, 6],
971+
"foo2": [1, 2, 4, 4, 5, 6],
972972
}
973973
)
974974
result = df.groupby("foo1", as_index=False).apply(lambda x: x.mean())
975-
expected = df.groupby("foo1", as_index=False).mean()
975+
expected = DataFrame(
976+
{
977+
"foo1": ["one", "three", "two"],
978+
"foo2": [3.0, 4.0, 4.0],
979+
}
980+
)
976981
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)