[Numpy-tickets] [NumPy] #741: Extend numpy.dot() to accept more than 2 arrays.

NumPy numpy-tickets@scipy....
Thu Apr 17 05:41:03 CDT 2008

#741: Extend numpy.dot() to accept more than 2 arrays.
 Reporter:  joris        |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:  1.0.5   
Component:  numpy.core   |     Version:  none    
 Severity:  normal       |    Keywords:          
 if a,b,c,d are numpy arrays, than their matrix multiplication can be
 computed with:

 dot(a, dot(b, dot(c, d)))

 or by

 array(mat(a) * mat(b) * mat(c) * mat(d))

 More convenient would be dot(a,b,c,d). An easy way to implement this would

 def dot(*args):
     return reduce(olddot, args)

 where 'olddot' is the current implementation of dot that only takes 2
 arguments. The suggestion above would not break any code, as dot(a,b) ==

Ticket URL: <http://scipy.org/scipy/numpy/ticket/741>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list