Reproducible code:
x = np.array([0.9, 0.9, 1])
y = np.array([0, 0, 1])
y[x<1] = 1 - x[x<1]
print(y)
Output
array([0, 0, 1])
Desired output
array([0.1, 0.1, 1])
I know np.where will get me the desired output. I'm just curious about why boolean indexing doesn't work in this case.