Reverse zip() ?

Andreas Waldenburger geekmail at usenot.de
Tue Dec 2 21:09:30 CET 2008


Hi all,

we all know about the zip builtin that combines several iterables into
a list of tuples.

I often find myself doing the reverse, splitting a list of tuples into
several lists, each corresponding to a certain element of each tuple
(e.g. matplotlib/pyplot needs those, rather than lists of points).

This is of course trivial to do via iteration or listcomps, BUT, I was
wondering if there is a function I don't know about that does this
nicely?

redards
/W

-- 
My real email address is constructed by swapping the domain with the
recipient (local part).



More information about the Python-list mailing list