unzip function?

Devin Jeanpierre jeanpierreda at gmail.com
Wed Jan 18 11:15:49 EST 2012


On Wed, Jan 18, 2012 at 10:31 AM, Rodrick Brown <rodrick.brown at gmail.com> wrote:
> Alec can you explain this behavior zip(*zipped)?

Here's one way to think about it: If A is a matrix, zip(*A) returns
the transpose of A. That is, the columns become rows, and the rows
become columns.

If you swap rows and columns, and then swap them back, you're left
with the original.

-- Devin



More information about the Python-list mailing list