In [17]:
import numpy as np
Vectors are usually 1 dim.
To access an attribute/element of a vector as $\vec v_i$:
v[i]
When having a stacked vector in matrix, to access the $i$-th vector stacked as col vectors:
mat[:, i]
To access the $i$-th vector stacked as row vectors:
mat[i, :]
# or simply
mat[i]
In [19]:
dim = 3
X = np.array([]).reshape(dim, 0)
X
Out[19]:
In [51]:
vec = [1, 2, 3]
Y = np.c_[X, vec]
Y
Out[51]:
In [52]:
Y = np.c_[Y, vec]
Y
Out[52]:
In [53]:
mat = np.expand_dims(vec, axis=1)
mat
Out[53]:
In [54]:
np.hstack((Y, mat))
Out[54]:
In [ ]: