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:41:37 EST 2011
On Wed, Dec 21, 2011 at 11:27 AM, Nathan Rice
<nathan.alexander.rice at gmail.com> wrote:
> Ian, can you clarify the expected output in that case? My initial
> guess would be that you want to do a modulo on the cartesian product
> of parameters from the proxies, sort of like:
>
> import itertools
> numerator = range(5)
> denominator = [2, 2, 3, 3, 3]
>
> remainder = [n % d for (n, d) in itertools.product(numerator, denominator)]
I expected the equivalent of:
remainder = [n % d for (n, d) in zip(numerator, denominator)]
which is what numpy does.
More information about the Python-list
mailing list