numba выдает ошибку. что делать?
Реализую поиск ближайшего объекта относительно точки xb,yb. Пытаюсь ускорить код с помощью numba, но что-то не работает. Можете подсказать, где ошибка?
import random
import numba as nb
from numba import jit,jit,prange
import time
xb,yb = 100,50
@nb.njit(parallel = True)
def sortes():
a = []
minr = []
for x in prange(10000):
a.append([random.randint(0,800),random.randint(0,800)])
for x in prange(len(a)):
minr.append( [abs(a[x][0] - xb) + abs(a[x][1] - yb), [a[x][0] , a[x][1]] ])
m = sorted(minr)
print(m[0])
print(m[len(m)-1])
t = time.time()
sortes()
t1 = time.time()
print(t1-t)
ошибка
Traceback (most recent call last):
File "c:\Users\User\Desktop\x = 10.py", line 21, in <module>
sortes()
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\numba\core\dispatcher.py", line 468, in _compile_for_args
error_rewrite(e, 'typing')
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\numba\core\dispatcher.py", line 409, in error_rewrite
raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Poison type used in arguments; got Poison<LiteralList((int64, List(int64, False)))>
During: resolving callee type: BoundFunction(list.append for list(undefined)<iv=None>)
During: typing of call at c:\Users\User\Desktop\x = 10.py (15)
File "Desktop\x = 10.py", line 15:
def sortes():
<source elided>
for x in prange(len(a)):
minr.append( [abs(a[x][0] - xb) + abs(a[x][1] - yb), [a[x][0] , a[x][1]] ])
^