Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17686

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

References <CAOFbRmLyw88pHNSdszQY672ukAcm965jDUamXQGOFXoX9pd3+Q@mail.gmail.com> <CALwzidkOYp8FzfQ-s4wiNHy4TW3R03Cq7qQDSSNV=Zcf1OgQkA@mail.gmail.com> <CAOFbRm+p-aJGz_9FULsz=qOY9Htwd2XVKbS6Y-pc7wwoFfGQ-A@mail.gmail.com> <CAJ6cK1bxFaS46CpDmJ_cJy2GEnmeYxPsepN2YAzPxafvzc8UUg@mail.gmail.com>
Date 2011-12-21 13:16 -0500
Subject Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.
From Nathan Rice <nathan.alexander.rice@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3937.1324491392.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Dec 21, 2011 at 12:53 PM, Arnaud Delobelle <arnodel@gmail.com> wrote:
>
> You can already do:
>
> efoo2 = ["one", "two", "three", "four"]
> ["_".join(reversed((x.capitalize() + " little indian").split(" ")) * 2)
>     for x in efoo2]
>
> Note 1: I've ignored the fact that reversed(...)*2 is erroneous
> Note 2: I wouldn't such code myself, in either form
>
> What's the advantage of your elementwise stuff?

Sit two theoretically identical programmers who have a decent grasp of
python, understand the basics of ElementwiseProxy and the components
of your version down side by side, and see which one can figure out
what the output should be first.  I will bet real money it is the one
working with the ElementwiseProxy code.  We have all had a lot of
practice reading inside out and backwards in the python community with
comprehensions and such, but it is in no way natural or easy.

Additionally, everything done via an ElementwiseProxy is lazy, so you
only pay for what you eat :)

Nathan

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. Nathan Rice <nathan.alexander.rice@gmail.com> - 2011-12-21 13:16 -0500

csiph-web