title: Numpy: how to use argmax results to get the actual max?
body: <p>Suppose I have a 3D array:</p>
  
  <pre><code>&gt;&gt;&gt; a
  array([[[7, 0],
          [3, 6]],
  
         [[2, 4],
          [5, 1]]])
  </code></pre>
  
  <p>I can get its <code>argmax</code> along <code>axis=1</code> using</p>
  
  <pre><code>&gt;&gt;&gt; m = np.argmax(a, axis=1)
  &gt;&gt;&gt; m
  array([[0, 1],
         [1, 0]])
  </code></pre>
  
  <p>How can I use <code>m</code> as an index into <code>a</code>, so that the results are equivalent to simply using <code>max</code>?</p>
  
  <pre><code>&gt;&gt;&gt; a.max(axis=1)
  array([[7, 6],
         [5, 4]])
  </code></pre>
  
  <p>(This is useful when <code>m</code> is applied to other arrays of the same shape)</p>