Versions of this question have already been asked but I have not found a satisfactory answer.
Problem: given a large numpy vector, find indices of t
This solution using the numpy_indexed package has complexity n Log n, and is fully vectorized; so not terribly different from C performance, in all likelihood.
import numpy_indexed as npi dpl = np.flatnonzero(npi.multiplicity(vect) > 1)