[Numpy-discussion] array of matrices
Wed Apr 8 02:56:12 CDT 2009
On Wed, Apr 01, 2009 at 01:40:54AM +0000, Hans-Andreas Engel wrote:
> By the way, matrix multiplication is one of the testcases for the generalized
> ufuncs in numpy 1.3 -- this makes playing around with it easy:
> In : N = 10; a = randn(N, 4, 4); b = randn(N, 4, 4)
> In : import numpy.core.umath_tests
> In : (numpy.core.umath_tests.matrix_multiply(a, b) == [dot(ai, bi) for (ai,
> bi) in zip(a, b)]).all()
> Out: True
I am jumping on your message to stress that generalized ufunc realy need
a bit more documentation. I have been trying to push a few collegues to
use them, but I am getting not traction, because they are unsure of what
generalized ufuncs do.
I wasn't aware of the example you mentioned. It certainly is useful.
Maybe it would be useful to add it as an example to the generalized-ufunc
with a discussion of the example. If you, or anyone else who knows
generalized ufuncs, register on the above webpage, I can give rights to
edit the page, so that you can improve the docs.
More information about the Numpy-discussion