numba 加速 Python for循环
用numba来加速Python 循环执行不下去{:5_107:} ,求大神指点一二~#代码
@nb.jit()
def nb1():
for i in range(len(df1)):
if df1.iloc['首3邮编'] < '350':
df1['落地点'].at = 'JFK'
elif df1.iloc['首3邮编'] >= '790':
df1['落地点'].at = 'LAX'
else:
df1['落地点'].at = 'ORD'
nb1()
# error
Compilation is falling back to object mode WITHOUT looplifting enabled because Function "nb1" failed type inference due to: Cannot determine Numba type of <class 'numba.core.dispatcher.LiftedLoop'>
File "面料克重2.py", line 67:
def nb1():
for i in range(len(df1)):
^
@nb.jit()
File "面料克重2.py", line 67:
def nb1():
for i in range(len(df1)):
^
warnings.warn(errors.NumbaDeprecationWarning(msg,
本帖最后由 傻眼貓咪 于 2022-7-3 13:25 编辑
@nb.jit? @nb.jit()
你这个是啥? 装饰器的话,也没看到你引入包啊? 是你自己在逗自己玩,还是别人在逗你玩?
页:
[1]