So lets say I have a numpy array that looks like this:
a=np.array([1, 2, 3, 4])
and another variable that says the number of times I want it repeated, like 3.
My desired result would be:
[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
I know I could use a loop and np.concatenate() to achieve this, but I'm working with very large arrays, and was hoping for a more efficient way to do this because it seems to me that np.concatenate with a loop would take quite a long time if I have a large array and need it duplicated a large number of times (this would result in a lot of expensive copies). Is there a more efficient way to do this?