File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1212import numpy as np
1313
1414import pandas ._libs .window as libwindow
15+ import pandas .compat as compat
1516from pandas .compat ._optional import import_optional_dependency
1617from pandas .compat .numpy import function as nv
1718from pandas .util ._decorators import Appender , Substitution , cache_readonly
@@ -1159,15 +1160,17 @@ def impl(window, *_args):
11591160
11601161 return impl
11611162
1162- @numba .njit
1163+ @numba .njit ( nogil = True , parallel = not compat . is_platform_32bit ())
11631164 def roll_apply (
11641165 values : np .ndarray ,
11651166 begin : np .ndarray ,
11661167 end : np .ndarray ,
11671168 minimum_periods : int ,
11681169 ):
11691170 result = np .empty (len (begin ))
1170- for i , (start , stop ) in enumerate (zip (begin , end )):
1171+ for i in numba .prange (len (result )):
1172+ start = begin [i ]
1173+ stop = end [i ]
11711174 window = values [start :stop ]
11721175 count_nan = np .sum (np .isnan (window ))
11731176 if len (window ) - count_nan >= minimum_periods :
You can’t perform that action at this time.
0 commit comments