I'm trying to index a 2D array with another 2D array which works fine in Numpy, but I want to use it in a function decorated with Numba's njit decorator, which gives me this error:
TypingError: No implementation of function Function(<built-in function getitem>) found for signature:
getitem(array(float64, 2d, C), array(int32, 2d, C))
There are 22 candidate implementations:
- Of which 20 did not match due to:
Overload of function 'getitem': File: <numerous>: Line N/A.
With argument(s): '(array(float64, 2d, C), array(int32, 2d, C))':
No match.
- Of which 2 did not match due to:
Overload in function 'GetItemBuffer.generic': File: numba/core/typing/arraydecl.py: Line 166.
With argument(s): '(array(float64, 2d, C), array(int32, 2d, C))':
Rejected as the implementation raised a specific error:
NumbaTypeError: unsupported array index type array(int32, 2d, C) in [array(int32, 2d, C)]
raised from /home/martin/anaconda3/envs/scrapyenv/lib/python3.10/site-packages/numba/core/typing/arraydecl.py:72
I've tried to break it down into for loops in a separate function, but keep getting the same error. Is there a simple solution or an easy way to get around this issue?