Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #10978
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:two': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'tuple': 0.09; 'elements,': 0.16; 'received:173.11': 0.16; 'subject:list': 0.18; '>>>': 0.18; 'header:In-Reply-To:1': 0.22; 'separate': 0.28; 'lists': 0.28; 'subject:?': 0.31; 'list': 0.32; 'there': 0.33; 'to:addr:python-list': 0.33; '...': 0.34; 'header:User-Agent:1': 0.34; 'header:X-Complaints-To:1': 0.35; 'subject:lists': 0.36; 'two': 0.37; 'received:org': 0.38; 'subject:: ': 0.39; 'header :Mime-Version:1': 0.39; 'to:addr:python.org': 0.39 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Emile van Sebille <emile@fenx.com> |
| Subject | Re: how to separate a list into two lists? |
| Date | Sat, 06 Aug 2011 10:24:10 -0700 |
| References | <CAN1Fwxcdtt0u_TT=civMes1hA2qvfkH2YckES7B7qRE++DXzJQ@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | 173-11-108-137-sfba.hfc.comcastbusiness.net |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
| In-Reply-To | <CAN1Fwxcdtt0u_TT=civMes1hA2qvfkH2YckES7B7qRE++DXzJQ@mail.gmail.com> |
| 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.1986.1312651348.1164.python-list@python.org> (permalink) |
| Lines | 17 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1312651348 news.xs4all.nl 23908 [2001:888:2000:d::a6]:47726 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:10978 |
Show key headers only | View raw
On 8/6/2011 10:07 AM smith jack said...
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
>>> L = [('a1', 'b1'), ('a2', 'b2'),('an', 'bn')]
>>> zip(*L)
[('a1', 'a2', 'an'), ('b1', 'b2', 'bn')]
Emile
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: how to separate a list into two lists? Emile van Sebille <emile@fenx.com> - 2011-08-06 10:24 -0700
Re: how to separate a list into two lists? bud <only@fleshwound.org> - 2011-08-06 18:21 +0000
Re: how to separate a list into two lists? Chris Angelico <rosuav@gmail.com> - 2011-08-06 19:35 +0100
Re: how to separate a list into two lists? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-07 10:13 +1000
csiph-web