Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.
Nathan Rice
nathan.alexander.rice at gmail.com
Tue Dec 20 19:31:02 EST 2011
> efoo2 = ElementwiseProxy(["one", "two", "three", "four"])
>
> efoo_res = ((efoo2.capitalize() + " little indian").split("
> ").apply(reversed) * 2).apply("_".join) # note that you could do
> reversed(...) instead, I just like to read left to right
> efoo_res.parent.parent.parent # same as ((efoo2.capitalize() + "
> little indian").split(" ") in case you need to debug something and
> want to look at intermediate values
Just a quick note, I realized after I sent this that reversed returns
an iterator, so * will not work. Otherwise everything is kosher.
More information about the Python-list
mailing list