>>> a = np.array([[1, 2], [3, 4]])
>>> b = np.array([[5, 6]])
>>> np.concatenate((a, b), axis=0)
array([[1, 2],
[3, 4],
[5, 6]])
>>> np.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
[3, 4, 6]])
import numpy as np
a = np.array([[0, 1, 3], [5, 7, 9]])
b = np.array([[0, 2, 4], [6, 8, 10]])
c = np.concatenate((a, b), axis=0)
print(c)
Output :
[[ 0 1 3]
[ 5 7 9]
[ 0 2 4]
[ 6 8 10]]
numpy.concatenate([arr1, arr2]) # Joining arr1 and arr2
a = np.array([1, 2, 3, 4])
b = np.array([5, 6, 7, 8])
np.concatenate((a, b))
#concatenating through column(axis = 1)
numpy.concatenate((N,M),1)