Is there an efficient way to access multiple slices of an array with a flexible number of slices ? Example below with a for loop I would like to avoid, left and right arrays lenghts are variable...
a = np.array([0,1,2,3,4,5,6,7,8,9])
left =np.array([0,5])
right = np.array([2,8])
for i in range(len(left)):
a[left[i]:right[i]] = -1