I have numpy array as follows:
train_x = [[1,2,3,0,0], [2,5,0,0,0], [2,3,0,0,0], [0,0,0,0,0], [0,0,0,0,0,0]]
Now, I would like to transform it to as shown below:
new_train_x = [[0,0,0,0,0],[0,0,0,0,0,0],[0,0,1,2,3],[0,0,0,2,5],[0,0,0,2,3]]
I tried writing manually. The length of such list is huge. But it is time consuming.
I would like to know the efficient and short code for this (manually takes time).