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 future, Numeric is the "past", but in the present
Numeric is better (and more mature) at some stuff than Numarray.

Learning both is not much harder than learning one, actually (they
share a lot).

--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to