Skip to content

Commit 15aa86e

Browse files
committed
add cutoff in cython
1 parent d413792 commit 15aa86e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/window/aggregations.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ cdef float64_t calc_skew(int64_t minp, int64_t nobs,
508508
# if the variance is less than 1e-14, it could be
509509
# treat as zero, here we follow the original
510510
# skew/kurt behaviour to check B <= 1e-14
511-
elif B <= 1e-14:
511+
elif B <= 1e-14 and nobs > 100 or B <= 1e-16:
512512
result = NaN
513513
else:
514514
R = sqrt(B)

0 commit comments

Comments
 (0)