[Numpy-discussion] A basic question on the dot function

Matthieu Brucher matthieu.brucher@gmail....
Wed Oct 17 03:16:43 CDT 2007


>
> what I'm searching for is :
>
> In [18]: dotprod2(a,b)
> Out[18]: array([ 0.28354876,  0.54474092,  0.22986942,  0.42822669,
> 0.98179793])
>
> where I defined a "classical" (in the way I understand it. I may not
> understand it properly ?) dot product between these 2 vectors.
>
> def dotprod2(a,b):
>   return sum(a*b,axis=0)
>

I think this is your best choice ;)

Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071017/349d26c0/attachment.html 


More information about the Numpy-discussion mailing list