>>> a = np.array([1,2,3])# >>> b = np.array([2,3,4])>>> np.vstack((a,b))# 两个[1,3]垂直堆叠 --> [2,3]
array([[1,2,3],[2,3,4]])>>> a = np.array([[1],[2],[3]])# 两个[3,1]垂直堆叠 --> [6,1]>>> b = np.array([[2],[3],[4]])>>> np.vstack((a,b))
array([[1],[2],[3],[2],[3],[4]])
np.vstack(list or tuple) 水平堆叠数组
>>> a = np.array((1,2,3))>>> b = np.array((2,3,4))>>> np.hstack((a,b))array([1,2,3,2,3,4])>>> a = np.array([[1],[2],[3]])>>> b = np.array([[2],[3],[4]])>>> np.hstack((a,b))array([[1,2],[2,3],[3,4]])