I have an array, sigma. If any element of sigma is less than threshold, then the value of the specific element is equal to the threshold. The current and expected outputs are presented.
import numpy as np
sigma = np.array([[ 0.02109 ],
[ 0.01651925],
[ 0.02109 ],
[ 0.02109 ],
[ -0.009 ]])
threshold = 0.010545
for i in range(0, len(sigma)):
if(sigma[i] <= threshold):
sigma[i] == threshold
print([sigma])
The current output is
[array([[ 0.02109 ],
[ 0.01651925],
[ 0.02109 ],
[ 0.02109 ],
[-0.009 ]])]
The expected output is
[array([[0.02109 ],
[0.01651925],
[0.02109 ],
[0.02109 ],
[0.010545 ]])]