[Numpy-discussion] array of matrices

Robert Kern robert.kern@gmail....
Fri Mar 27 17:43:25 CDT 2009


On Fri, Mar 27, 2009 at 17:38, Bryan Cole <bryan@cole.uklinux.net> wrote:
> I have a number of arrays of shape (N,4,4). I need to perform a
> vectorised matrix-multiplication between pairs of them I.e.
> matrix-multiplication rules for the last two dimensions, usual
> element-wise rule for the 1st dimension (of length N).
>
> (How) is this possible with numpy?

dot(a,b) was specifically designed for this use case.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list