dot products

Alan G Isaac aisaac at american.edu
Mon Dec 20 22:11:47 EST 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