|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
用numba来加速Python 循环执行不下去 ,求大神指点一二~
#代码
@nb.jit()
def nb1():
for i in range(len(df1)):
if df1.iloc[i]['首3邮编'] < '350':
df1['落地点'].at[i] = 'JFK'
elif df1.iloc[i]['首3邮编'] >= '790':
df1['落地点'].at[i] = 'LAX'
else:
df1['落地点'].at[i] = '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,
|
|