Skip to content

Commit edc2393

Browse files
committed
perf: recompute the window less
1 parent 8020107 commit edc2393

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
@@ -611,14 +611,15 @@ def roll_skew(ndarray[float64_t] values, ndarray[int64_t] start,
611611
add_skew(val, &nobs, &mean, &m2, &m3, &numerically_unstable)
612612

613613
if requires_recompute or numerically_unstable:
614-
numerically_unstable = False
615614
mean = m2 = m3 = 0.0
616615
nobs = 0
617616

618617
for j in range(s, e):
619618
val = values[j]
620619
add_skew(val, &nobs, &mean, &m2, &m3, &numerically_unstable)
621620

621+
numerically_unstable = False
622+
622623
output[i] = calc_skew(minp, nobs, mean, m2, m3)
623624

624625
if not is_monotonic_increasing_bounds:

0 commit comments

Comments
 (0)