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

Method test_numba_min_periods

pandas/tests/window/test_numba.py:142–155  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

140 tm.assert_frame_equal(result, expected)
141
142 def test_numba_min_periods(self):
143 # GH 58868
144 def last_row(x):
145 assert len(x) == 3
146 return x[-1]
147
148 df = DataFrame([[1, 2], [3, 4], [5, 6], [7, 8]])
149
150 result = df.rolling(3, method="table", min_periods=3).apply(
151 last_row, raw=True, engine="numba"
152 )
153
154 expected = DataFrame([[np.nan, np.nan], [np.nan, np.nan], [5, 6], [7, 8]])
155 tm.assert_frame_equal(result, expected)
156
157 @pytest.mark.parametrize(
158 "data",

Callers

nothing calls this directly

Calls 3

DataFrameClass · 0.90
applyMethod · 0.45
rollingMethod · 0.45

Tested by

no test coverage detected