I have an array of numbers, a. I have a second array, b, specifying how many times I want to retrieve the corresponding element in a. How
a
b
Thats exactly what np.arange(5).repeat([1,0,3,2,0]) does.
np.arange(5).repeat([1,0,3,2,0])