NumPy loop efficiency
Carlos Alberto Reis Ribeiro
cribeiro at mail.inet.com.br
Fri Mar 30 06:30:23 EST 2001
>It does create a temporary array. Getting rid of this would be a lot
>of work, array expressions would have to use lazy evaluation.
(out of the top of my mind; I dont have Numeric installed on my home
computer, and have no way to test it right now)
The intermediate array is not really needed, but the python expresion
evaluator have no way to know it. However, something like the ufuncs could
be used. For instance, something like this could be done (the names are
just examples):
z = arrayadd(a, b, c)
or the more generic solution:
z = arraymap(add, a, b, c)
The first one could be optimized for the most common cases (I'm sure adding
arrays is one of these operations).
Carlos Ribeiro
More information about the Python-list
mailing list