Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python add column to a matrix

import numpy as np

X = np.random.uniform(size=(10,3))
n,m = X.shape # for generality
X0 = np.ones((n,1))
Xnew = np.hstack((X,X0))
 
PREVIOUS NEXT
Tagged: #python #add #column #matrix
ADD COMMENT
Topic
Name
4+8 =