Henrik Holm wrote:
John Lenton <[EMAIL PROTECTED]> wrote:


def dotproduct(a, b):
  psum = 0
  for i in range(len(a)):
      psum += a[i]*b[i]
  return psum

for this particular example, the most pythonic way is to do nothing at all, or, if you must call it dotproduct,

from Numeric import dot as dotproduct


Downloading, installing, and getting to know numerical modules for
Python is mext on my list :).  However, I was under the impression that
Numarray is preferred to Numeric -- is that correct?  Are these two
competing packages?  (Hopefully this is not flame war bait...)


Numarray is the replacement for Numeric. Some people are still using Numeric for a variety of reasons, e.g. they use a package that has not been updated to use numarray, they can't afford the performance penalty that numarray has for small arrays, etc.


Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to