On Fri, Aug 27, 2010 at 1:35 PM, Robert Kern <robert.k...@gmail.com> wrote: > [~] > |8> %timeit kern_in(ar, valid) > 10 loops, best of 3: 115 ms per loop > > [~] > |9> %timeit np.in1d(ar, valid) > 1 loops, best of 3: 279 ms per loop > > As valid gets larger, in1d() will catch up but for smallish sizes of > valid, which I suspect given the "non-numeric" nature of the OP's (Hi, > Brett!) request, kern_in() is usually better.
Oh well, I was just guessing based on algorithmic properties. Sounds like there might be some optimizations possible to in1d then, if anyone had a reason to care :-). -- Nathaniel _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion