Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.
Ian Kelly
ian.g.kelly at gmail.com
Wed Dec 21 13:39:07 EST 2011
On Wed, Dec 21, 2011 at 11:24 AM, Joshua Landau
<joshua.landau.ws at gmail.com> wrote:
> I was under the impression that these were meant to be interchangeable. This
> is because functions are just wrappers to non-functions, really.
>
>>>> from elementwise import ElementwiseProxy as P
>>>> (lambda x:x+[1])(P([[0],[0],[0]]))
> [0, 1], [0, 1], [0, 1]
>
> If we have to use .apply, we might as well use map :P.
Agreed. The advantage of .apply here is that when the functions are
nested they are written left-to-right. But I wouldn't be using
multiple maps or applys on a single line anyway -- my goal is to write
clear code, not great one-liners. :-D
More information about the Python-list
mailing list