Also, do not use np.int32 as dtype, but np.intp.