MCPcopy
hub / github.com/pandas-dev/pandas / test__cython_agg_general

Function test__cython_agg_general

pandas/tests/groupby/aggregate/test_cython.py:172–181  ·  view source on GitHub ↗
(op, targop)

Source from the content-addressed store, hash-verified

170 ],
171)
172def test__cython_agg_general(op, targop):
173 df = DataFrame(np.random.default_rng(2).standard_normal(1000))
174 labels = np.random.default_rng(2).integers(0, 50, size=1000).astype(float)
175 kwargs = {"ddof": 1} if op == "var" else {}
176 if op not in ["first", "last"]:
177 kwargs["axis"] = 0
178
179 result = df.groupby(labels)._cython_agg_general(op, alt=None, numeric_only=True)
180 expected = df.groupby(labels).agg(targop, **kwargs)
181 tm.assert_frame_equal(result, expected)
182
183
184@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

groupbyMethod · 0.95
DataFrameClass · 0.90
_cython_agg_generalMethod · 0.80
astypeMethod · 0.45
aggMethod · 0.45

Tested by

no test coverage detected