Suppose I have a list of list called mat
of shape 5x5
.
Then I initialize a "column", element by element as follows
mat[0][4] = 'X'
mat[1][4] = 'O'
mat[2][4] = 'R'
mat[3][4] = 'N'
mat[4][4] = 'A'
Is there any way to initialize this column vector in one line in Python
like how MATLAB
might do?
mat[:,4] = ['X','O','R','N','A']