Skip to content

Commit b45c164

Browse files
committed
move location to initialize num_consecutive_same_value down
1 parent 1c96112 commit b45c164

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/_libs/window/aggregations.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def roll_var(const float64_t[:] values, ndarray[int64_t] start,
363363
cdef:
364364
float64_t mean_x, ssqdm_x, nobs, compensation_add,
365365
float64_t compensation_remove, prev_value
366-
int64_t s, e, num_consecutive_same_value = 0
366+
int64_t s, e, num_consecutive_same_value
367367
Py_ssize_t i, j, N = len(start)
368368
ndarray[float64_t] output
369369
bint is_monotonic_increasing_bounds
@@ -386,6 +386,7 @@ def roll_var(const float64_t[:] values, ndarray[int64_t] start,
386386
if i == 0 or not is_monotonic_increasing_bounds or s >= end[i - 1]:
387387

388388
prev_value = values[s]
389+
num_consecutive_same_value = 0
389390

390391
mean_x = ssqdm_x = nobs = compensation_add = compensation_remove = 0
391392
for j in range(s, e):

0 commit comments

Comments
 (0)