Suppose I have np.array like below
dat = array([[ 0, 1, 0],
[ 1, 0, 0],
[0, 0, 1]]
)
What I want to do is that adding the (index of row + 1) as a new column to this array, which is like
newdat = array([[ 0, 1, 0, 1],
[ 1, 0, 0, 2],
[0, 0, 1, 3]]
)
How should I achieve this.