list math for version 1.5.2 without Numeric
J.Jacob
joost_jacob at hotmail.com
Thu Nov 29 09:59:17 EST 2001
Oh I forgot that functions can be assigned to variables in Python,
elimination lookup. As a dutch saying has it I was "comparing apples
with pears".
version_6:
add = operator.add
mul = operator.mul
for j in range_nh:
wij = wi[j]
sum = reduce(add, map(mul, ai, wij))
Takes 71 seconds
Hmmm, still not the fastest version...
------------------------------------------------------------
<thou-shalt-not-use-dots-in-for-loops>
More information about the Python-list
mailing list