[Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

Eelco Hoogendoorn hoogendoorn.eelco at gmail.com
Mon Feb 17 18:23:00 EST 2014


considering np.dot takes only its binary positional args and a single
defaulted kwarg, passing in a variable number of positional args as a list
makes sense. Then just call the builtin reduce on the list, and there you
go.

I also generally approve of such semantics for binary associative
operations.


On Mon, Feb 17, 2014 at 11:27 PM, Jaime Fernández del Río <
jaime.frio at gmail.com> wrote:

> Perhaps you could reuse np.dot, by giving its second argument a default
> None value, and passing a tuple as first argument, i.e. np.dot((a, b, c))
> would compute a.dot(b).dot(c), possibly not in that order.
>
> As is suggested in the matlab thread linked by Josef, if you do implement
> an optimal ordering algorithm, then precalculating the ordering and passing
> it in as an argument should be an option.
>
> If I get a vote, I am definitely +1 on this, especially the more
> sophisticated version.
>
> On Feb 17, 2014 1:40 PM, "Stefan Otte" <stefan.otte at gmail.com> wrote:
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140218/b725e280/attachment.html>


More information about the NumPy-Discussion mailing list