dot products

Alan G Isaac aisaac at american.edu
Tue Dec 21 04:11:47 CET 2004


[Rahul].
> I want to compute dot product of two vectors stored as lists a and b.a
> and b are of the same length

from scipy import dot
ans=dot(a,b)

This times faster than the alternatives I have seen mentioned so far,
given scipy.

Cheers,
Alan Isaac





More information about the Python-list mailing list