In the documentation,据说该功能是
水平(按列)按顺序堆叠数组。
我不太了解“列明智”的确切含义。有人可以用文档提供的示例代码来解释它吗?
>>> a = np.array([[1],[2],[3]])
>>> b = np.array([[2],[3],[4]])
>>> np.hstack((a,b))
array([[1, 2],
[2, 3],
[3, 4]])
答案 0 :(得分:3)
数组A看起来像这样:
1
2
3
数组B看起来像这样:
2
3
4
放入数组B 沿数组A:
A B
1 2
2 3
3 4
这是您的新阵列!