title: Python: How to get values of a multi-dimensional array at certain indexed positions?
body: <p>If I have a multi-dimensional numpy array like:</p>
  
  <pre><code>a = [[0 1 2]
       [3 4 5]
       [6 7 8]]
  </code></pre>
  
  <p>How can I get the values at certain index positions in one step? For example, if were to define pairs of indices like:</p>
  
  <pre><code>indices = [[0,0], [1,1], [2,2]]
  </code></pre>
  
  <p>I would like:</p>
  
  <pre><code>a[indices] = [0, 4, 8]
  </code></pre>
  
  <p>Note that this does work for one-dimensional arrays (<a href="https://stackoverflow.com/questions/25201438/python-how-to-get-values-of-an-array-at-certain-index-positions">Python: How to get values of an array at certain index positions?</a>), but I cannot see how to get this to work in more than one dimension. I am using Python 3.7.</p>