Array Concatenation
import numpy as np
x = np.array([1, 2, 3])
y = np.array([3, 2, 1])
np.concatenate([x, y]) # = array([1, 2, 3, 3, 2, 1])
# concatenate along the second axis (zero-indexed)
np.concatenate([x, y], axis=1)
# vertically stack the arrays
np.vstack([x, y])
# horizontally stack the arrays
np.hstack([grid, y])
from numpy import hstack, concatenate, vstack, dstack, column_stack, row_stack
a = arange(9).reshape(3,3) #Set up array
b = 2 * a #Set up array
hstack((a,b)) #Stack horizontally
concatenate((a,b), axis = 1) #Same as hstack
vstack((a,b)) #Stack vertically
concatenate((a,b), axis=0) #Same as vstack
dstack((a,b)) #Stack arrays on top of each other
oned = arange(2)
twice_oned = 2 * oned
column_stack((oned,twice_oned)) #Stack 1D arrays column-wise
column_stack((a,b)) #Same as hstack
row_stack((oned,twice_oned)) #Stack 1D arrays row-wise
row_stack((a,b)) #Same as vstack
row_stack((a,b)) == vstack((a,b)) #True