I have two numpy arrays I want to make a index by index comparision,
For example
a=[1,'aaa', 'bbb', 'vvv', 'www']
b=[2,'qqq', 'bbb', 'ppp', 'www']
Normally an itersection would compare each value of an array to each value of a different array,
Is there any efficient way is python to compare two np arrays index wise From the above example when we perform intersection between a and b, we see that value 2 of array b is compared to all the values in a , similarly value 'qqq' of array b is compared to all the values in the array a, which at the worst case can give a n*n complexity, n being the length of the array.
The output of above exmaple would result as 2 (True for 'bbb' and 'www')
What I want is that the intersection could be made index wise, lets say when array b is compared to a. value2 in array b should be compared to only value 1 of array a, and object 'qqq' of b should be compared to object 'aaa' of a and so on ..
This would also solve the n*n worst case complexity of above intersection result.