title: find the index of largest, 2nd largest or third largest in a row of multidimensional array pyhton
body: <p>Let say I have the following two numpy arrays:</p>
  
  <pre><code>a = numpy.array([[1,4,6,2,5],[3,2,7,12,1],[8,5,3,1,4],[6,10,2,4,9]])
  b = numpy.array([0, 1, 4])
  </code></pre>
  
  <p>now, I want to first search for the index of the max value in a specific row (just say second row <code>a[1,:]</code>), I have another array <code>b</code> with some numbers in it and if the index of the max value is present as an element in the other <code>b</code>, i use that index number for some more calculation. If the index of max value from a row of <code>a</code> is not present as an element in <code>b</code>, I need to look for the index of the 2nd largest number, and if that index value is present in <code>b</code> as an element, i go for it otherwise look for the index of third largest number and so on. I do not want to sort the array <code>a</code>. </p>
  
  <p>In the above example, I have <code>[3,2,7,12,1]</code> in the second row.The index of the max number is 3 but that 3 is not present in b, then index of 2nd largest is 2, which is also not present in b, then i look for the index of third largest which is 0 and that is present in b. So I then assign 0 to a new variable. Any quick and fast way of doing it? Thanks in advance.  </p>