In R there is the rep function that allows you to repeat a vector, and with the additional argument length.out one is able to specify the length of the final vector/array, e.g.:
> rep(1:3, length.out = 10)
[1] 1 2 3 1 2 3 1 2 3 1
Is there a similar way in Python to do this? I have found the repeat function in Numpy, but one is only able to specify number of times to repeat.