I have a two-dimensional NumPy array with shape
(2, 2)
Example array
array([[1, 2], [3, 4]])
I am trying to have it copy on just the first axis until it reaches the shape:
(5, 2)
Example result array
array([[1, 2], [1, 2], [1, 2], [3, 4], [3, 4]])
np.repeat does the job but it has to be a multiple as it repeats everything
np.repeat(arr, 3, axis=0)
array([[1, 2], [1, 2], [1, 2], [3, 4], [3, 4], [3, 4]])
giving a 6 by 2 array and not a 5 by 2 array