Skip to content

Commit

Permalink
CLN: Update Cython data pointers for rolling apply (pandas-dev#34930)
Browse files Browse the repository at this point in the history
* CLN: Update Cython data pointers for rolling apply
  • Loading branch information
mroeschke authored Jun 23, 2020
1 parent 4ce3e30 commit 7d6377d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pandas/_libs/window/aggregations.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1377,17 +1377,11 @@ def roll_generic_fixed(object obj,
output[i] = NaN

# remaining full-length windows
buf = <float64_t *>arr.data
bufarr = np.empty(win, dtype=float)
oldbuf = <float64_t *>bufarr.data
for i in range((win - offset), (N - offset)):
buf = buf + 1
bufarr.data = <char *>buf
for j, i in enumerate(range((win - offset), (N - offset)), 1):
if counts[i] >= minp:
output[i] = func(bufarr, *args, **kwargs)
output[i] = func(arr[j:j + win], *args, **kwargs)
else:
output[i] = NaN
bufarr.data = <char *>oldbuf

# truncated windows at the end
for i in range(int_max(N - offset, 0), N):
Expand Down

0 comments on commit 7d6377d

Please sign in to comment.