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
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
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
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