Let A be a numpy array like :
A = np.array([1, 2, 3, 4, 5])
I want to find the cleaner way to produce a new array with each value repeated two times:
B = np.array([1, 1, 2, 2, 3, 3, 4, 4, 5, 5])
Do you think this is the simpler way to do it ?
import numpy as np
B = np.tile(A,2).reshape(2,-1).flatten('F')