Numpy conditional multiply data in array (if true multiply A, false multiply B)
np.where is the answer. I spend time messing with np.place without knowing its existence.
Say I have a large array of value 0~255. I wanted every element in this array that is higher than 100 got multiplied by 1.2, otherwise, got multiplied by 0.8.
It sounded simple but I could not find anyway other than iterate through all the variable and multiply it one by one.