Python how to combine two matrices in numpy
Use numpy.concatenate
:
>>> import numpy as np
>>> np.concatenate((A, B))
matrix([[ 1., 2.],
[ 3., 4.],
[ 5., 6.]])
You can use numpy.vstack
:
>>> np.vstack((A,B))
matrix([[ 1., 2.],
[ 3., 4.],
[ 5., 6.]])