numpy/matlab compatibility

Matt Funk mafunk at nmsu.edu
Tue Jan 25 15:13:02 EST 2011


Hi,

i am fairly new to python. I was wondering of the following is do-able
in python:

1) a = rand(10,1)
2) Y = a
3) mask = Y > 100;
4) Y(mask) = 100;
5) a = a+Y

Basically i am getting stuck on line 4). I was wondering if it is
possible or not with python?
(The above is working matlab code)

thanks
matt



More information about the Python-list mailing list