Skip to content

Commit f799b42

Browse files
committed
Test now uses reduction_func
1 parent d093eae commit f799b42

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

pandas/tests/groupby/test_function.py

+19-21
Original file line numberDiff line numberDiff line change
@@ -585,33 +585,31 @@ def test_ops_general(op, targop):
585585
tm.assert_frame_equal(result, expected)
586586

587587

588-
@pytest.mark.parametrize(
589-
"op",
590-
[
591-
"mean",
592-
"median",
593-
"std",
594-
"var",
595-
"sum",
596-
"prod",
597-
"min",
598-
"max",
599-
"first",
600-
"last",
601-
"count",
602-
"sem",
603-
],
604-
)
605-
def test_ops_not_as_index(op):
588+
def test_ops_not_as_index(reduction_func):
606589
# GH 10355
607590
# Using as_index=False should not modify grouped column
591+
592+
# GH 5755
593+
if reduction_func in (
594+
"corrwith",
595+
"idxmax",
596+
"idxmin",
597+
"mad",
598+
"ngroup",
599+
"nth",
600+
"nunique",
601+
"size",
602+
"skew",
603+
):
604+
pytest.skip("Skip until #5755 is resolved")
605+
608606
df = DataFrame(np.random.randint(0, 5, size=(100, 2)), columns=["a", "b"])
609-
expected = getattr(df.groupby("a"), op)().reset_index()
607+
expected = getattr(df.groupby("a"), reduction_func)().reset_index()
610608

611-
result = getattr(df.groupby("a", as_index=False), op)()
609+
result = getattr(df.groupby("a", as_index=False), reduction_func)()
612610
tm.assert_frame_equal(result, expected)
613611

614-
result = getattr(df.groupby("a", as_index=False)["b"], op)()
612+
result = getattr(df.groupby("a", as_index=False)["b"], reduction_func)()
615613
tm.assert_frame_equal(result, expected)
616614

617615

0 commit comments

Comments
 (0)