Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Julian Taylor
On 28.11.2014 04:15, Alexander Belopolsky wrote: I probably miss something very basic, but how given two arrays a and b, can I find positions in a where elements of b are located? If a were sorted, I could use searchsorted, but I don't want to get valid positions for elements that are not in

Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Robert Kern
On Fri, Nov 28, 2014 at 8:22 AM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 28.11.2014 04:15, Alexander Belopolsky wrote: I probably miss something very basic, but how given two arrays a and b, can I find positions in a where elements of b are located? If a were sorted, I

Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Julian Taylor
On 28.11.2014 09:37, Robert Kern wrote: On Fri, Nov 28, 2014 at 8:22 AM, Julian Taylor jtaylor.deb...@googlemail.com mailto:jtaylor.deb...@googlemail.com wrote: On 28.11.2014 04:15, Alexander Belopolsky wrote: I probably miss something very basic, but how given two arrays a and b, can I

Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Robert Kern
On Fri, Nov 28, 2014 at 8:40 AM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 28.11.2014 09:37, Robert Kern wrote: On Fri, Nov 28, 2014 at 8:22 AM, Julian Taylor jtaylor.deb...@googlemail.com mailto:jtaylor.deb...@googlemail.com wrote: On 28.11.2014 04:15, Alexander

Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Nathaniel Smith
On Fri, Nov 28, 2014 at 3:15 AM, Alexander Belopolsky ndar...@mac.com wrote: I probably miss something very basic, but how given two arrays a and b, can I find positions in a where elements of b are located? If a were sorted, I could use searchsorted, but I don't want to get valid positions

Re: [Numpy-discussion] Finding values in an array

2014-11-28 Thread Benjamin Root
If we don't have an operation for this in numpy's setops module, it probably should be added. Ben Root On Nov 28, 2014 10:21 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Fri, Nov 28, 2014 at 5:15 PM, Nathaniel Smith n...@pobox.com wrote: On Fri, Nov 28, 2014 at 3:15 AM,

[Numpy-discussion] Finding values in an array

2014-11-27 Thread Alexander Belopolsky
I probably miss something very basic, but how given two arrays a and b, can I find positions in a where elements of b are located? If a were sorted, I could use searchsorted, but I don't want to get valid positions for elements that are not in a. In my case, a has unique elements, but in the

Re: [Numpy-discussion] Finding values in an array

2014-11-27 Thread Stephan Hoyer
On Thu, Nov 27, 2014 at 10:15 PM, Alexander Belopolsky ndar...@mac.com wrote: I probably miss something very basic, but how given two arrays a and b, can I find positions in a where elements of b are located? If a were sorted, I could use searchsorted, but I don't want to get valid positions