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

Bill Baxter wbaxter@gmail....
Tue Oct 16 13:20:49 CDT 2007

On 10/17/07, Julien Hillairet <julien.hillairet@gmail.com> wrote:
> Hello,
> First of all, I'm sorry if this question had already been asked. I've
> searched on the gmane archive and elsewhere on internet, but I didn't found
> the answer to my question.
> As expected, the dot product of 2 'classical' vectors works fine :
> In [50]: a0 = numpy.array([1,2,3])
> In [51]: numpy.dot(a0,a0)
> Out[51]: 14
> What I don't understand, is why the dot product of a (3,N) vector gives an
> error :

dot() also serves as Numpy's matrix multiply function.  So it's trying
to interpret that as a (3,N) matrix times a (3,N) matrix.

See examples here:


More information about the Numpy-discussion mailing list