Is there some way in python to add columns into a matrix.I want to add a column in the beginning of my mxn matrix in python.Say for example,I have 1000x100 matrix and I want to make it into 1000x101 matrix. I want to insert new column having all ones in the beginning i.e. it will be my new first column. Is it possible in python?
Here is my code-
vector1 is a list, cnt is 1000
data=np.array(vector1)
shape = ( cnt, 100 )
data=data.reshape(shape)
Now to this I want to add a new column at beginning with all ones
np.ones((1000,1)). Just straightforward use ofnp.concatenate.