I have three arrays
a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) #Original large array
b = np.array([4, 8, 5]) #Smaller array
c = np.array([2, 7, 9]) #Arguments
The result should look like the following
np.array([4, 4, 4, 8, 8, 8, 8, 8, 5, 5])
This means that [0, 1, 2] are replaced by 4, [3, 4, 5, 6, 7] are replaced by 8 and [8, 9] are placed by 5. Is there any numpy function/code for that?
b.repeat(np.diff(c,prepend=-1))?