Use np.intp_t for indices