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


Groups > comp.lang.python > #19091

Re: unzip function?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jeanpierreda@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.072
X-Spam-Evidence '*H*': 0.86; '*S*': 0.00; 'rows': 0.09; 'am,': 0.12; 'cc:addr:python-list': 0.15; 'columns': 0.16; 'rows,': 0.16; 'subject:function': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'jan': 0.19; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:addr:gmail.com': 0.28; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'subject:?': 0.30; 'cc:2**2': 0.30; 'received:209.85.160.46': 0.35; 'received:mail- pw0-f46.google.com': 0.35; 'received:209.85.160': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'received:209': 0.39; 'subject:: ': 0.39; 'back,': 0.64; 'become': 0.69; 'brown': 0.80; '10:31': 0.84; 'swap': 0.84; 'original.': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=mM3Qy3P1H/Vo/AHXoYh7f6Mw+0iXRS5mI2rxphu0z5A=; b=GmkOKgl5zSLQxp0WB3gKTe0uOaSiZ12y1YTNHLWrucc0qm2QIhdK5CmAuUrMku/2O8 Qx9woEtzcT9xmy8nDhbr5n5u6hcuDAoNQ1oNNM/zXpMFuKOwjfwIjqBUn+VohilI8ZqW SSduFsOdRzOgvokPIgRo8ytHPlWhxVr1icl20=
MIME-Version 1.0
In-Reply-To <CABRP1o-pfRfZm6Mde_LNukYvkm+dvjhysemD=Q_VoTaa4WXQ6g@mail.gmail.com>
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 Wed, 18 Jan 2012 11:15:49 -0500
Subject Re: unzip function?
To Rodrick Brown <rodrick.brown@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc Neal Becker <ndbecker2@gmail.com>, python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4839.1326903394.27778.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1326903394 news.xs4all.nl 6879 [2001:888:2000:d::a6]:44052
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19091

Show key headers only | 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