Iterate and assign value - Python - Numpy
<p>IÂ´m a newbie in Python.</p>

<p>IÂ´m trying to do something like this. Iterate an array, compare the value with a constant and assign values to another array.</p>

<p><img src="http://i.stack.imgur.com/r0Sqk.jpg" alt="What IÂ´m trying to do"></p>

<p>Thanks in advance!</p>

<p>Regards</p>

<p>Eduardo</p>

<pre><code>a1 = numpy.array(range(10))
a2 = numpy.array(range(15,25))
print a2[a1==5]
print a2[a1 &gt;= 8]
print a2[a1 &lt; 5]
</code></pre>

<p>etc...</p>

python arrays loops numpy