title: How to find last occurrence of maximum value in a numpy.ndarray
body: <p>I have a numpy.ndarray in which the maximum value will mostly occur more than once.</p>
  
  <p>EDIT: This is subtly different from <a href="https://stackoverflow.com/questions/7038975">numpy.argmax: how to get the index corresponding to the *last* occurrence, in case of multiple occurrences of the maximum values</a> because the author says </p>
  
  <blockquote>
    <p>Or, even better, is it possible to get a list of indices of all the occurrences of the maximum value in the array?</p>
  </blockquote>
  
  <p>whereas in my case getting such a list may prove <em>very</em> expensive</p>
  
  <p>Is it possible to find the index of the last occurrence of the maximum value by using something like <code>numpy.argmax</code>? I want to find <em>only</em> the index of the last occurrence, not an array of all occurrences (since several hundreds may be there)</p>
  
  <p>For example this will return the index of the first occurrence ie 2</p>
  
  <pre><code>import numpy as np
  a=np.array([0,0,4,4,4,4,2,2,2,2])
  print np.argmax(a)
  </code></pre>
  
  <p>However I want it to output 5.</p>