I am trying numba to optimize some code. I looked at the source examples in section 1.3.1 in the 0.26.0 user guide ( http://numba.pydata.org/numba-doc/0.26.0/user/jit.html ) and get the expected results, so I donβt think what the problem is installation.
Here is my code:
import numba import numpy import random a = 8 b = 4 def my_function(a, b): all_values = numpy.fromiter(range(a), dtype = int) my_array = [] for n in (range(a)): some_values = (all_values[all_values != n]).tolist() c = random.sample(some_values, b) my_array.append(sorted([n] + c)) return my_array print(my_function(a, b)) my_function_numba = numba.jit()(my_function) print(my_function_numba(a, b))
Which, after printing the expected results of the my_function call, returns the following error message:
ValueError Traceback (most recent call last) <ipython-input-8-b5d8983a58f6> in <module>() 19 my_function_numba = numba.jit()(my_function) 20
Fingerprint of an empty list?
source share