I would allocate the ind = np.arange(n) outside of the loop.

besides LGTM