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


Groups > comp.lang.python > #19091

Re: unzip function?

References <jf6l7v$m3k$1@dough.gmane.org> <CAO+9iGfC60mJFgFwJNBEDE+bx4zkNUEunMAg3urCN-3RJd0g7Q@mail.gmail.com> <CAO+9iGcG_=xhVP1W=TRJo6fSCTNPQJ4cvsiYHRi5c7_fmJs-vQ@mail.gmail.com> <CABRP1o-pfRfZm6Mde_LNukYvkm+dvjhysemD=Q_VoTaa4WXQ6g@mail.gmail.com>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date 2012-01-18 11:15 -0500
Subject Re: unzip function?
Newsgroups comp.lang.python
Message-ID <mailman.4839.1326903394.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jan 18, 2012 at 10:31 AM, Rodrick Brown <rodrick.brown@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: unzip function? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-18 11:15 -0500

csiph-web