In [1]: import numpy as npIn [2]: a = np.array([[1, 2, 3], [4, 5, 6]])In [3]: b = np.array([[9, 8, 7], [6, 5, 4]])In [4]: np.concatenate((a, b))Out[4]: array([[1, 2, 3], [4, 5, 6], [9, 8, 7], [6, 5, 4]])
或这个:
In [1]: a = np.array([1, 2, 3])In [2]: b = np.array([4, 5, 6])In [3]: np.vstack((a, b))Out[3]: array([[1, 2, 3], [4, 5, 6]])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)