<div dir="ltr">On Fri, Nov 28, 2014 at 8:22 AM, Julian Taylor <<a href="mailto:jtaylor.debian@googlemail.com">jtaylor.debian@googlemail.com</a>> wrote:<br>><br>> On 28.11.2014 04:15, Alexander Belopolsky wrote:<br>> > I probably miss something very basic, but how given two arrays a and b,<br>> > can I find positions in a where elements of b are located?  If a were<br>> > sorted, I could use searchsorted, but I don't want to get valid<br>> > positions for elements that are not in a.  In my case, a has unique<br>> > elements, but in the general case I would accept the first match.  In<br>> > other words, I am looking for an array analog of list.index() method.<br>><br>> np.where(np.in1d(a, b))<br><br>Only if the matching elements in `b` have the same order as they do in `a`.<br><br>--<br>Robert Kern</div>