[SciPy-User] [scipy-user] How to apply a condition on some specific values of an array

Fabien Lafont lafont.fabien@gmail....
Fri Feb 3 04:48:50 CST 2012


I think my title is not very clear, but I don't know how to formulate it...

I'm just starting to use numpy and I have still Python's reflexes so I
want to know how can I do the following code using Numpy "style".

for i in range(0,len(array)+1):
       if 10<array[i]<100:
            new_array = array[i]*1000

In other words is it possible to "scan" the values of an array and
apply a "modification" to it if the condition is true

Thanks!

Fabien


More information about the SciPy-User mailing list