"multi" zip
Emile van Sebille
emile at fenx.com
Thu Jun 27 12:05:01 EDT 2002
Mark
> 1) instead of producing tuples, I'd like to produce lists.
>
> 2) I'd like to extend this to an arbitrary number of lists. If it
were
> possible, I'd do zip(line[0], line[1], ..., line[n]) but this doesn't
seem
> to compile :).
>
> Is there a way to make zip() do this, or should I stop trying to
hammer with
> a wrench?
>
>>> line = [range(ii*10,11*10+5) for ii in range(5) ]
>>> map (list,zip(*line))
HTH,
--
Emile van Sebille
emile at fenx.com
---------
More information about the Python-list
mailing list