[Numpy-discussion] Get the index of a comparison of two lists

2011-02-16 Thread FRENK Andreas
Hi, Thanks for the two solutions. Indeed, there are much faster than the brute force method using in. The setmember1d is deprecate din newer python releases, therefore I already switched to in1d(). (Thanks Josef.) Andreas ___ NumPy-Discussion mailing

Re: [Numpy-discussion] Get the index of a comparison of two lists

2011-02-11 Thread josef . pktd
On Fri, Feb 11, 2011 at 9:48 AM, Angus McMorland wrote: > On 11 February 2011 09:01, FRENK Andreas wrote: >> Hi, >> >> I need to create a construct that returns the index of entries of the first >> list, if values in the first and second list are equal. >> >> Take >> >> valA = [1,2,3,4,20,21,22,2

Re: [Numpy-discussion] Get the index of a comparison of two lists

2011-02-11 Thread Angus McMorland
On 11 February 2011 09:01, FRENK Andreas wrote: > Hi, > > I need to create a construct that returns the index of entries of the first > list, if values in the first and second list are equal. > > Take > > valA = [1,2,3,4,20,21,22,23,24] > valB = [1,2,3,4,  5,21,22,23] > The correct solution is: [0

[Numpy-discussion] Get the index of a comparison of two lists

2011-02-11 Thread FRENK Andreas
Hi, I need to create a construct that returns the index of entries of the first list, if values in the first and second list are equal. Take valA = [1,2,3,4,20,21,22,23,24] valB = [1,2,3,4, 5,21,22,23] The correct solution is: [0,1,2,3,5,6,7] A potential loop can be: takeList=[] for j,a in enu