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


Groups > comp.lang.python > #17684 > unrolled thread

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

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2011-12-21 10:54 -0700
Last post2011-12-21 10:54 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-21 10:54 -0700

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

FromIan Kelly <ian.g.kelly@gmail.com>
Date2011-12-21 10:54 -0700
SubjectRe: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.
Message-ID<mailman.3935.1324490112.27778.python-list@python.org>
On Tue, Dec 20, 2011 at 12:45 PM, Nathan Rice
<nathan.alexander.rice@gmail.com> wrote:
> Elementwise provides a proxy object for iterables which supports
> chained method calls, as well as elementwise expressions and some
> built-in functions.

It doesn't seem to work correctly when both operands are Elementwise:

>>> numerator = ElementwiseProxy(range(5))
>>> denominator = ElementwiseProxy([2, 2, 3, 3, 3])
>>> remainder = numerator % denominator
>>> print remainder
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "elementwise.py", line 72, in __repr__
    return ", ".join(e.__repr__() for e in
object.__getattribute__(self, "iterable"))
TypeError: sequence item 0: expected string, ElementwiseProxy found
>>> list(remainder)
[]

Cheers,
Ian

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web