[Numpy-discussion] How do I do this?

Alan G Isaac aisaac@american....
Fri Aug 29 16:55:51 CDT 2008


Christopher Barker wrote:
> I need to do something I thought would be simple -- set 
> all the values of an array to some minimum. so I did this:

Does this do what you want?
idx = np.abs(a)<min_value
a[idx] = min_value

Cheers,
Alan




More information about the Numpy-discussion mailing list