Skip to content

Commit aafef93

Browse files
committed
added test for float32
1 parent e2e4fb6 commit aafef93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/window/test_rolling.py

+8
Original file line numberDiff line numberDiff line change
@@ -1424,3 +1424,11 @@ def test_rolling_zero_window():
14241424
result = s.rolling(0).min()
14251425
expected = Series([np.nan])
14261426
tm.assert_series_equal(result, expected)
1427+
1428+
1429+
def test_rolling_float_dtype(float_dtype):
1430+
# GH#42452
1431+
df = DataFrame({"A": range(5), "B": range(10, 15)}, dtype=float_dtype)
1432+
expected = DataFrame({"A": [np.nan] * 5, "B": range(10, 20, 2)}, dtype=float_dtype)
1433+
result = df.rolling(2, axis=1).sum()
1434+
tm.assert_frame_equal(result, expected, check_dtype=False)

0 commit comments

Comments
 (0)