[Numpy-discussion] Repeated Dot Operations

T J tjhnson@gmail....
Mon Jul 20 05:27:59 CDT 2009


Hi,

Is there a good way to perform dot on an arbitrary list of arrays
which avoids using a loop?  Here is what I'd like to avoid:

# m1, m2, m3  are arrays
>>> out = np.(m1.shape[0])
>>> prod = [m1, m2, m3, m1, m2, m3, m3, m2]
>>> for m in prod:
... out = np.dot(out, m)
...

I was hoping for something like np.dot.reduce(prod).


More information about the NumPy-Discussion mailing list