TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function setitem>) found for signature:
This error is encountered when tried to set all the elements less than a given threshold in matrix the SG_Z
to zero by using the following command SG_Z[SG_Z < Threshold] = 0
This command is being used in a function that is parallelized using Numba @jit
. Due to the existence of this line, the function is not running.
You don't say much about
SG_Z
but I suspect it is 2d (or higher).numba
has limited multidimensional indexing abilities (compared tonumpy
)The
numba
:It's not
setitem
in general that missing;numba
does this all the time. It'ssetitem
for this particular combination of arguments.It does work if I first ravel the array.
But in
numba
we don't need to be afraid of iteration, so for a 2d input we could iterate on rows:There may be more general ways of writing this, and providing signatures, but this should give some idea(s) of how to address this issue.