[Numpy-discussion] How do I do this?

Alan G Isaac aisaac@american....
Fri Aug 29 20:28:58 CDT 2008


>>> Alan G Isaac wrote:
>>>> Does this do what you want? 
>>>> idx = np.abs(a)<min_value 
>>>> a[idx] = min_value 

Christopher Barker wrote:
> -1 should go to -2

ok then:
a[idx] = min_value*np.sign(a[idx])
I think that's what you are saying?

Cheers,
Alan Isaac




More information about the Numpy-discussion mailing list