values = np.array([4, 4, 4, 4, 4, 4, 4, 4, 4, 4])
quality = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
threshold = 4
value = 17
values[quality < threshold] = value
Replace values in a list depending on value of other list?