Skip to content

Commit fd68eb4

Browse files
author
auderson
committed
add equal-zero test for test_rolling_var_numerical_issues & test_rolling_var_floating_artifact_precision
1 parent 2ad5e6b commit fd68eb4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/window/test_rolling.py

+6
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,9 @@ def test_rolling_var_numerical_issues(func, third_value, values):
12031203
result = getattr(ds.rolling(2), func)()
12041204
expected = Series([np.nan] + values)
12051205
tm.assert_series_equal(result, expected)
1206+
# GH 42064
1207+
# new `roll_var` will output 0.0 correctly
1208+
tm.assert_series_equal(result == 0, expected == 0)
12061209

12071210

12081211
def test_timeoffset_as_window_parameter_for_corr():
@@ -1521,6 +1524,9 @@ def test_rolling_var_floating_artifact_precision():
15211524
result = s.rolling(3).var()
15221525
expected = Series([np.nan, np.nan, 4 / 3, 0])
15231526
tm.assert_series_equal(result, expected, atol=1.0e-15, rtol=1.0e-15)
1527+
# GH 42064
1528+
# new `roll_var` will output 0.0 correctly
1529+
tm.assert_series_equal(result == 0, expected == 0)
15241530

15251531

15261532
def test_rolling_std_small_values():

0 commit comments

Comments
 (0)