On 09/16/2010 08:24 AM, Andre Alexander Bell wrote:
or you could write the loop
>>> m1m2 = np.empty_like(m1)
>>> for i in range(m1m2.shape[0]):
... m1m2[i] = np.dot(m1, m2)
This should have been
... m1m2[i] = np.dot(m1[i], m2[i])
Sorry for the typo.
Andre
--
http://mail.python.org/mailma
Hi,
I assume you have arrays like these:
>>> import numpy as np
>>> m1 = np.random.rand(size=(4,3,3))
>>> m2 = np.random.rand(size=(4,3,3))
So that m1[0] is a 3x3 Matrix and m1[1] is another one, i.e. you have
four matrices.
On 09/15/2010 01:54 AM, Gregory Ewing wrote:
I had thought that do
On Sep 14, 4:54 pm, Gregory Ewing wrote:
> Suppose I have two N+2 dimensional arrays, representing
> N-d arrays of 2-d matrices. I want to perform matrix
> multiplication between corresponding matrices in these
> arrays.
>
> I had thought that dot() might do this, but it appears
> not, because e.g
On 9/15/10 11:36 AM, Colin J. Williams wrote:
On 14-Sep-10 19:54 PM, Gregory Ewing wrote:
Suppose I have two N+2 dimensional arrays, representing
N-d arrays of 2-d matrices. I want to perform matrix
multiplication between corresponding matrices in these
arrays.
I had thought that dot() might do
On Tue, Sep 14, 2010 at 7:54 PM, Gregory Ewing
wrote:
> Suppose I have two N+2 dimensional arrays, representing
> N-d arrays of 2-d matrices. I want to perform matrix
> multiplication between corresponding matrices in these
> arrays.
>
> I had thought that dot() might do this, but it appears
> not
On 14-Sep-10 19:54 PM, Gregory Ewing wrote:
Suppose I have two N+2 dimensional arrays, representing
N-d arrays of 2-d matrices. I want to perform matrix
multiplication between corresponding matrices in these
arrays.
I had thought that dot() might do this, but it appears
not, because e.g. applyin