[Numpy-discussion] Fast vector multiplication

Mark Janikas mjanikas at esri.com
Fri Jan 19 17:40:32 EST 2007

Hello all,


I am trying to figure out the most efficient way to get the sum of the
product of two vectors where id != id.




X = array([1,2,3])

Y = array([1,2,3])


Z = (1*2) + (1*3) + (2*1) + (2*3) + (3*1) + (3*2) = 22


I could obviously do this with loops, but I was wondering if there is a
version of multiply that could be used... or a form of vectorize.  Any
ideas would be greatly appreciated. 


Mark Janikas

Product Engineer

ESRI, Geoprocessing

380 New York St.

Redlands, CA 92373

909-793-2853 (2563)

mjanikas at esri.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070119/5d04d6a9/attachment.html>

More information about the NumPy-Discussion mailing list