import numpy as np a=np.array([[1,2,3],[4,5,6],[7,8,9]]) b=np.array([[10,12,11],[100,5,79]]) b1_above_a=np.reshape(np.append(b[1,:],a),(4,3)) a_above_b1=np.reshape(np.append(a,b[1,:]),(4,3))