1>>> a = np.array([[1, 2], [3, 4]])
2>>> b = np.array([[5, 6]])
3>>> np.concatenate((a, b), axis=0)
4array([[1, 2],
5 [3, 4],
6 [5, 6]])
7>>> np.concatenate((a, b.T), axis=1)
8array([[1, 2, 5],
9 [3, 4, 6]])
10
1import numpy as np
2
3a = np.array([[0, 1, 3], [5, 7, 9]])
4b = np.array([[0, 2, 4], [6, 8, 10]])
5c = np.concatenate((a, b), axis=0)
6print(c)
7
8Output :
9[[ 0 1 3]
10 [ 5 7 9]
11 [ 0 2 4]
12 [ 6 8 10]]