I have a array X structured with shape 2, 5 as follows:
0, 6, 7, 9, 1
2, 4, 6, 2, 7
I'd like to reshape it to repeat each row n times as follows (example uses n = 3):
0, 6, 7, 9, 1
0, 6, 7, 9, 1
0, 6, 7, 9, 1
2, 4, 6, 2, 7
2, 4, 6, 2, 7
2, 4, 6, 2, 7
I have tried to use np.tile as follows, but it repeats as shown below:
np.tile(X, (3, 5))
0, 6, 7, 9, 1
2, 4, 6, 2, 7
0, 6, 7, 9, 1
2, 4, 6, 2, 7
0, 6, 7, 9, 1
2, 4, 6, 2, 7
How might i efficiently create the desired output?