[Numpy-discussion] Repeated Dot Operations

T J tjhnson at gmail.com
Mon Jul 20 06:27:59 EDT 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