Sure, just use broadcasting with arange(m), make sure to use an np.array for the indices, not a list...
>>> indice = [1, 0, 2]
>>> m = 3
>>> np.arange(m) <= np.array(indice)[..., None]
#false #array #array([[ #arange(m) #with
https://stackoverflow.com/questions/6... https://stackoverflow.com/questions/6...