On Wed, Feb 27, 2013 at 5:41 AM, Jorge Scandaliaris <jorgesmbox-ml@yahoo.es> wrote:
Jorge Scandaliaris <jorgesmbox-ml <at> yahoo.es> writes:
> I have an ndarray A of shape (M,2,2) representing M 2 x 2 matrices.
> Now I want to apply a transform T of shape (2,2) to each of matrix.

np.einsum makes a lot of these easier to figure out:

In [7]: np.einsum('ijk, kl', A, T)
Out[7]: 
array([[[ 7, 10],
        [15, 22]],

       [[23, 34],
        [31, 46]],

       [[39, 58],
        [47, 70]]])

Jaime
 
--
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial.