Skip to content

Commit 6431ae5

Browse files
committed
fix: sliding window exclusive end index
1 parent e4a3939 commit 6431ae5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/_libs/window/aggregations.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def roll_var(const float64_t[:] values, ndarray[int64_t] start,
442442

443443
# Over the first window, observations can only be added
444444
# never removed
445-
if i == 0 or not is_monotonic_increasing_bounds or s <= end[i]:
445+
if i == 0 or not is_monotonic_increasing_bounds or s < end[i]:
446446

447447
prev_value = values[s]
448448
num_consecutive_same_value = 0

pandas/tests/window/test_rolling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ def test_rolling_sem(frame_or_series):
11561156
def test_rolling_var_correctness(func, values, window, ddof, expected_values):
11571157
# GH: 37051, 42064, 54518, 52407, 47721
11581158
ts = Series(values)
1159-
result = getattr(ts.rolling(window=window, center=True), func)(ddof=ddof)
1159+
result = getattr(ts.rolling(window=window), func)(ddof=ddof)
11601160
if result.last_valid_index():
11611161
result = result[
11621162
result.first_valid_index() : result.last_valid_index() + 1

0 commit comments

Comments
 (0)