title: Numpy 2d array - select multiple elements without a for loop
body: <p>I maintain some code and I run across something like:</p>
  
  <pre><code>    travel_time_vec = np.zeros(...)
      for v in some_indexes: # some_indexes is a list of row indexes
          traveltimes = traveltime_2d_array[v, list_of_column_indexes]
          best_index = np.argmin(traveltimes)
          travel_time_vec[v] = traveltimes[best_index]
  </code></pre>
  
  <p>I would like to drop the for loop and do all the operations below at once - but naively asking for <code>traveltime_2d_array[some_indexes, list_of_column_indexes]</code> results in:</p>
  
  <blockquote>
    <p>{IndexError}shape mismatch: indexing arrays could not be broadcast together with shapes (4,) (8,)</p>
  </blockquote>