[Numpy-discussion] searchsorted for exact matches, not preserving order

Robert Kern robert.kern@gmail....
Fri Sep 11 10:33:28 CDT 2009


On Fri, Sep 11, 2009 at 10:24, Andrew Jaffe<a.h.jaffe@gmail.com> wrote:
> Dear all,
>
> I've got two (integer) arrays, and I want to find the indices in the
> first one that have entries in the second. I.E. I want all idx s.t.
> there exists a j with a[idx]=b[j]. Here is my current implementation
> (with a = pixnums, b=surveypix)

numpy.setmember1d() [or numpy.in1d() for the SVN trunk of numpy].

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the NumPy-Discussion mailing list