>
> 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(
2007/10/16, Timothy Hochberg <[EMAIL PROTECTED]>:
>
>
> You might try tensordot. Without thinking it through too much:
> numpy.tensordot(a0, a1, axes=[-1,-1])
> seems to do what you want.
>
>
Thank you.
However, it works only for this simple example, where a0 and a1 are similar.
The tensor product
On 10/16/07, Julien Hillairet <[EMAIL PROTECTED]> wrote:
>
> 2007/10/16, Bill Baxter <[EMAIL PROTECTED]>:
> >
> > 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:
> >
> > http://www.scipy.
2007/10/16, Bill Baxter <[EMAIL PROTECTED]>:
>
> 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:
>
> http://www.scipy.org/Numpy_Example_List_With_Doc#head-2a810f7dccd3f7c700d1076f15078ad1fe3c6d
Julien Hillairet 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 [
On 10/16/07, Julien Hillairet <[EMAIL PROTECTED]> 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
On 10/17/07, Julien Hillairet <[EMAIL PROTECTED]> 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'
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]: nump