I want to replicate the last row of an array in python and found the following lines of code in the numpy documentation
>>> x = np.array([[1,2],[3,4]])
I have test it using following code
>>> a
array([[1, 2],
[3, 4]])
>>> np.repeat(a, [2,3], axis = 0)
array([[1, 2],
[1, 2],
[3, 4],
[3, 4],
[3, 4]])
>>> np.repeat(a, [1,3], axis = 0)
array([[1, 2],
[3, 4],
[3, 4],
[3, 4]])
The second parameter seems mean how many times the i-th elements in a will be repeat. As my code shown above, [2,3] repeats a[0] 2 times and repeats a[1] 3 times, [1,3] repeats a[0] 1 times and repeats a[1] 3 times