Skip to content

Commit c5391d4

Browse files
authored
fix bugs roll_skew and roll_kurt in aggregations.pyx
1 parent 7bc2000 commit c5391d4

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

pandas/_libs/window/aggregations.pyx

-26
Original file line numberDiff line numberDiff line change
@@ -607,22 +607,9 @@ def roll_skew(ndarray[float64_t] values, ndarray[int64_t] start,
607607
start, end
608608
)
609609
output = np.empty(N, dtype=np.float64)
610-
min_val = np.nanmin(values)
611610
values_copy = np.copy(values)
612611

613612
with nogil:
614-
for i in range(0, V):
615-
val = values_copy[i]
616-
if val == val:
617-
nobs_mean += 1
618-
sum_val += val
619-
mean_val = sum_val / nobs_mean
620-
# Other cases would lead to imprecision for smallest values
621-
if min_val - mean_val > -1e5:
622-
mean_val = round(mean_val)
623-
for i in range(0, V):
624-
values_copy[i] = values_copy[i] - mean_val
625-
626613
for i in range(0, N):
627614

628615
s = start[i]
@@ -822,21 +809,8 @@ def roll_kurt(ndarray[float64_t] values, ndarray[int64_t] start,
822809
)
823810
output = np.empty(N, dtype=np.float64)
824811
values_copy = np.copy(values)
825-
min_val = np.nanmin(values)
826812

827813
with nogil:
828-
for i in range(0, V):
829-
val = values_copy[i]
830-
if val == val:
831-
nobs_mean += 1
832-
sum_val += val
833-
mean_val = sum_val / nobs_mean
834-
# Other cases would lead to imprecision for smallest values
835-
if min_val - mean_val > -1e4:
836-
mean_val = round(mean_val)
837-
for i in range(0, V):
838-
values_copy[i] = values_copy[i] - mean_val
839-
840814
for i in range(0, N):
841815

842816
s = start[i]

0 commit comments

Comments
 (0)