I have a vector of the following form:
import numpy as np
vec = np.array([2, 2, 2, 51, 51, 52, 52, 14, 14, 14, 51, 51, 52, 52])
Is there a numpy-thonic way to find the index of the first occurrence of a value that is not (for instance) 51 or 52? In other words, a function that would return the following indexes: [0, 7], where 0 is the index of the first apparition of 2, and 7 is the index of the first apparition of 14.

