If I have a list or array of values X
and I use the code:
X[X>=1]=1
I have a clean re-assignment of all values in X
greater than or equal to 1
set equal to 1
.
If I try the following:
X[X>0 and X<1] = 0.5
It ignores both and does nothing. Is there a way to have two inequalities enforced in a single line using this approach?