(self)
| 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", |