title: Elementwise multiplication of NumPy arrays of matrices
body: <p>I have two NumPy arrays (of equal length), each with (equally-sized, square) NumPy matrices as elements. I want to do elementwise matrix multiplication of these two arrays, i.e. get back a single array where the i-th element is the matrix product of the i-th elements of my two arrays.</p>
  
  <p>When I simply try to multiply the arrays together, it seems that the program tries to calculate the matrix product of the <em>arrays</em>, and then fails because their dimensionality is too high (1 for the array + 2 for the matrices which are its elements).</p>
  
  <p>The problem could of course be solved with a for-loop, but I was hoping that there was some way in which it could be done that keeps everything internal to NumPy, in order to take full advantage of its increased efficiency.f</p>
  
  <p>EDIT:</p>
  
  <p>To clarify, say I have two arrays <code>np.array([A, B, C])</code> and <code>np.array([X, Y, Z])</code> where <code>A</code>, <code>B</code>, <code>C</code>, <code>X</code>, <code>Y</code> and <code>Z</code> are all 3x3 square matrices, what I need is a function that will return <code>np.array([A*X, B*Y, C*Z])</code>, where <code>*</code> is matrix multiplication.</p>