Numpy: Multiplying arrays of matrices

Andre Alexander Bell post at andre-bell.de
Thu Sep 16 02:48:23 EDT 2010


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



More information about the Python-list mailing list