title: index by comparision of two numpy arrays in python
body: <p>I have two numpy arrays I want to make a index by index comparision,</p>
  
  <p>For example </p>
  
  <pre><code>a=[1,'aaa', 'bbb', 'vvv', 'www']
  b=[2,'qqq', 'bbb', 'ppp', 'www']
  </code></pre>
  
  <p>Normally an itersection would compare each value of an array to each value of a different array,</p>
  
  <p>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. </p>
  
  <p>The output of above exmaple would result as 2 (True for 'bbb' and 'www')</p>
  
  <p>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 ..</p>
  
  <p>This would also solve the n*n worst case complexity of above intersection result.</p>