我正在尝试沿 x 轴连接 4 个 numpy 矩阵。下面是我写的代码。
print(dt.shape)
print(condition.shape)
print(uc.shape)
print(rt.shape)
x = np.hstack((dt, condition, uc, rt))
print(x.shape)
我得到以下输出。
(215063, 1)
(215063, 1112)
(215063, 1)
(215063, 1)
我收到以下错误。
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)
最终输出应该是
(215063, 1115)