Le lundi 01 août 2011 à 15:01 +0530, dileep kunjaai a écrit :
> Dear sir,
> How can we fill a particular value in the place of number satisfying
> certain condition by another number in an array.
> A contain some negative value i want to change the negative numbers to
> '0'. I used 'masked_where', command but I failed.

Does np.clip fulfill your requirements ?
http://docs.scipy.org/doc/numpy/reference/generated/numpy.clip.html

Be aware that it needs an upper limit (which can be np.inf).

Another option
A[A<0] = 0.

-- 
Fabrice Silva

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to