Assume a numpy array x. How can I do x[x>value] = max(value1, x[x>value])?
x[x>value] = max(value1, x[x>value])
In words, if element x[i] > value, then x[i] = max(value1, x[i]).