Skip to content

Commit 6f21167

Browse files
committed
fix: undo scale check for m2
1 parent 0aa2949 commit 6f21167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/window/aggregations.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ cdef float64_t calc_skew(int64_t minp, int64_t nobs,
503503
# _zero_out_fperr(m2) to fix floating error.
504504
# if the variance is less than 1e-14, it could be
505505
# treat as zero, here we follow the original
506-
# skew/kurt behaviour to check m2 < n * (eps * eps * mean * mean)
507-
elif m2 < dnobs * (1e-28 * mean * mean if fabs(mean) > 1e-14 else 1e-14):
506+
# skew/kurt behaviour to check m2 <= n * 1e-14
507+
elif m2 <= dnobs * 1e-14:
508508
result = NaN
509509
else:
510510
moments_ratio = m3 / (m2 * sqrt(m2))

0 commit comments

Comments
 (0)