title: Selecting specific column in each row from array
body: <p>I am trying to select specific column elements for each row of a numpy array. For example, in the following example:</p>
  
  <pre><code>In [1]: a = np.random.random((3,2))
  Out[1]: 
  array([[ 0.75670668,  0.1283942 ],
         [ 0.51326555,  0.59378083],
         [ 0.03219789,  0.53612603]])
  </code></pre>
  
  <p>I would like to select the first element of the first row, the second element of the second row, and the first element of the third row. So I tried to do the following:</p>
  
  <pre><code>In [2]: b = np.array([0,1,0])
  
  In [3]: a[:,b]
  </code></pre>
  
  <p>But this produces the following output:</p>
  
  <pre><code>Out[3]: 
  array([[ 0.75670668,  0.1283942 ,  0.75670668],
         [ 0.51326555,  0.59378083,  0.51326555],
         [ 0.03219789,  0.53612603,  0.03219789]])
  </code></pre>
  
  <p>which clearly is not what I am looking for. Is there an easy way to do what I would like to do without using loops?</p>