<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 9, 2017 at 9:46 AM, Martin Spacek <span dir="ltr"><<a href="mailto:numpy@mspacek.mm.st" target="_blank">numpy@mspacek.mm.st</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Looking at my own habits and uses, it seems to me that finding the indices of matching values of one array in another is a more common use case than finding insertion indices of one array into another sorted array. So, I propose that np.search(), or something like it, could be even more useful than np.searchsorted().<br></blockquote><div><br></div>The current version of this PR only returns the indices of the <i>first</i> match (rather than all matches), which is an important detail. I would strongly consider including that detail in the name (e.g., by calling this "find_first" rather than "search"), because my naive expectation for a method called "search" is to find all matches.</div><div class="gmail_quote"><br></div><div class="gmail_quote">In any case, I agree that this functionality would be welcome. Getting the details right for a high performance solution is tricky, and there is strong evidence of interest given the 200+ upvotes on this StackOverflow question:</div><div class="gmail_quote"><a href="http://stackoverflow.com/questions/432112/is-there-a-numpy-function-to-return-the-first-index-of-something-in-an-array">http://stackoverflow.com/questions/432112/is-there-a-numpy-function-to-return-the-first-index-of-something-in-an-array</a><br></div><div class="gmail_quote"><br></div></div></div>