在Python中合并矩阵

时间:2016-09-02 11:02:16

标签: python matrix

我有一些不同长度的矩阵。尺寸为200 * 59,200 * 1和200 * 1,我想制作一个200 * 61的大矩阵。我该怎么办?

1 个答案:

答案 0 :(得分:1)

使用concatenate

中的numpy
import numpy as np
a = np.random.rand(200,59)
b = np.random.rand(200,1)
c = np.random.rand(200,1)

d = np.concatenate((a,b,c),axis=1)
print d.shape #(200,61)
相关问题