python中科学计算包numpy中矩阵的合并,需要用到如下两个函数:
列合并:np.column_stack() ,其中函数参数为一个tuple
行合并:np.row_stack(),其中函数参数为一个tuple
>>> import numpy as np
>>> a = np.arange(8).reshape(4, -1)
>>> print(a)
[[0 1]
[2 3]
[4 5]
[6 7]]
>>> b = np.arange(8, 16).reshape(4, -1)
>>> print(b)
[[ 8 9]
[10 11]
[12 13]
[14 15]]
>