Use np.repeatand then change the form -
np.repeat(A,4).reshape(-1,4)
That which reshape(-1,4)basically stores the number of columns 4, but -1indicates it calculates the number of rows based on the total size of the array to be resized. Thus, for this sample, as it np.repeat(A,4).sizeis 8, it assigns the 8/4 = 2number of rows. Thus, it converts np.repeat(A,4)to an array of 2Dforms (2,4).
np.repeat A 2D None/np.newaxis -
np.repeat(A[:,None],4,axis=1)
np.tile -
np.tile(A[:,None],4)