This is what I am doing now to achieve what I want.
In:
a=numpy.zeros((3,2))
a[range(a.shape[0]),[0,0,1]] = 1
a
Out:
array([[ 1., 0.],
[ 1., 0.],
[ 0., 1.]])
As you can see, I used range
function to select all the rows in a. Is there any other cleaner way to select every row?