Python indirect indexing
<p>This might be a super easy question if you know how to do it, but I just can't figure out the syntax:</p>

<p>I have an array of 5x10 zeros: <code>y1 = np.zeros((5,10))</code> and an array 5x1 of index: <code>index=np.array([2,3,2,5,6])</code>. For each row of <code>y1</code>, I would like to set 1 at the column given by the index. The result would look like</p>

<pre><code>array([[ 0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
   [ 0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.],
   [ 0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
   [ 0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.],
   [ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.]])
</code></pre>

<p>Anyone can help please :-) ?</p>