Cannot cast array(int64, 1d, C) to int32


I am new to Numba and I have been having some troubles with the data types, I tried to convert an np.int64 to np.int32, I kept tracing and discovered that the problem was the conversion from int64, however I have no clue of what could I try to solve it:
Cannot cast array(int64, 1d, C) to int32: %".7980" = load {i8*, i8*, i64, i64, i64*, [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, i64*, [1 x i64], [1 x i64]}* %"$350binary_subscr.172"

I have made an example:
import numpy as np

import numba

from numba import jit


def t_corrido_i():


    tarefas_pj=np.array([ 0,  9, 13, 15, 16])


    # Alternative for np.isin for numba

    requere_no_outro_proc=np.array([x in set(requere_nodes) for x in tarefas_pj])



Does anyone have a clue of what could that be?

hi there!
Numba thinks you are trying to convert the int64 array to an int32 scalar, that’s why it complains.

you can achieve the conversion to int32 by writing ix_nos_requeridos=np.where(requere_no_outro_proc)[0].astype(np.int32)


Thanks so much! It worked out perfectly!

Opened numpy constructors aren't typing correctly, invalid cast issued · Issue #6656 · numba/numba · GitHub to track, it should have been caught earlier.