📜  numpy 垂直堆栈数组 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:26.400000             🧑  作者: Mango

代码示例1
import numpy as np
# ensure same shape of arrays to be stacked.
a = np.arange(10).reshape(2,-1)
b = np.repeat(1, 10).reshape(2,-1)
# use vstack() to stack by row.
out = np.vstack((a,b))
## print output
print(out)
# a
# b