Skip to content

Commit

Permalink
fix bugs roll_skew and roll_kurt in aggregations.pyx
Browse files Browse the repository at this point in the history
  • Loading branch information
cutebomb authored Aug 5, 2023
1 parent 7bc2000 commit c5391d4
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions pandas/_libs/window/aggregations.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -607,22 +607,9 @@ def roll_skew(ndarray[float64_t] values, ndarray[int64_t] start,
start, end
)
output = np.empty(N, dtype=np.float64)
min_val = np.nanmin(values)
values_copy = np.copy(values)

with nogil:
for i in range(0, V):
val = values_copy[i]
if val == val:
nobs_mean += 1
sum_val += val
mean_val = sum_val / nobs_mean
# Other cases would lead to imprecision for smallest values
if min_val - mean_val > -1e5:
mean_val = round(mean_val)
for i in range(0, V):
values_copy[i] = values_copy[i] - mean_val

for i in range(0, N):

s = start[i]
Expand Down Expand Up @@ -822,21 +809,8 @@ def roll_kurt(ndarray[float64_t] values, ndarray[int64_t] start,
)
output = np.empty(N, dtype=np.float64)
values_copy = np.copy(values)
min_val = np.nanmin(values)

with nogil:
for i in range(0, V):
val = values_copy[i]
if val == val:
nobs_mean += 1
sum_val += val
mean_val = sum_val / nobs_mean
# Other cases would lead to imprecision for smallest values
if min_val - mean_val > -1e4:
mean_val = round(mean_val)
for i in range(0, V):
values_copy[i] = values_copy[i] - mean_val

for i in range(0, N):

s = start[i]
Expand Down

0 comments on commit c5391d4

Please sign in to comment.