Re: [Numpy-discussion] member1d and unique elements

2008-08-06 Thread Robert Cimrman
Hi Greg, Greg Novak wrote: > Argh. I could swear that yesterday I typed test cases just like the > one you provide, and it behaved correctly. Nevertheless, it clearly > fails in spite of my memory, so attached is a version which I believe > gives the correct behavior. It looks ok now, although

Re: [Numpy-discussion] member1d and unique elements

2008-08-05 Thread Greg Novak
Argh. I could swear that yesterday I typed test cases just like the one you provide, and it behaved correctly. Nevertheless, it clearly fails in spite of my memory, so attached is a version which I believe gives the correct behavior. Greg On Tue, Aug 5, 2008 at 9:00 AM, Robert Cimrman <[EMAIL P

Re: [Numpy-discussion] member1d and unique elements

2008-08-05 Thread Robert Cimrman
Greg Novak wrote: > I have two arrays of integers, and would like to know _where_ they > have elements in common, not just _which_ elements are in common. > This is because the entries in the integer array are aligned with > other arrays. This seems very close to what member1d advertises as > its

Re: [Numpy-discussion] member1d and unique elements

2008-08-03 Thread Gael Varoquaux
On Sun, Aug 03, 2008 at 07:16:42PM +0200, Stéfan van der Walt wrote: > 2008/8/3 Greg Novak <[EMAIL PROTECTED]>: > > First of all, my desired operation is well-posed: I'd like f(ar1, > > ar2) to return something in the shape of ar1 with True if the value at > > that position appears anywhere in ar2

Re: [Numpy-discussion] member1d and unique elements

2008-08-03 Thread Stéfan van der Walt
2008/8/3 Greg Novak <[EMAIL PROTECTED]>: > First of all, my desired operation is well-posed: I'd like f(ar1, > ar2) to return something in the shape of ar1 with True if the value at > that position appears anywhere in ar2 (regardless of duplication) and > False otherwise. Just because one-liners

[Numpy-discussion] member1d and unique elements

2008-08-03 Thread Greg Novak
I have two arrays of integers, and would like to know _where_ they have elements in common, not just _which_ elements are in common. This is because the entries in the integer array are aligned with other arrays. This seems very close to what member1d advertises as its function. However, member1d