I start with a 2×4 matrix A
import numpy as np
A = np.matrix([[1, 2, 3, 4], [5, 6, 7, 8]])
I also have another 1×4 matrix B
B = np.matrix([9, 10, 11, 12])
How do I concatenate A and B so that I get a 3×4 matrix C
C = [[9 10 11 12]
[1 2 3 4]
[5 6 7 8]]
Note that B is prepended before row 0 of matrix A.
From: http://docs.scipy.org/doc/numpy/reference/routines.array-manipulation.html