Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51105
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rafadurancastaneda@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.028 |
| X-Spam-Evidence | '*H*': 0.94; '*S*': 0.00; '[1]:': 0.09; '[2]:': 0.09; '[3]:': 0.09; 'escribi\xf3:': 0.16; 'itertools': 0.16; 'subject:Converting': 0.16; 'import': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'subject:list': 0.30; 'case,': 0.35; 'subject:lists': 0.35; 'received:google.com': 0.35; 'hi,': 0.36; 'message-id:@gmail.com': 0.38; 'skip:[ 10': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'email name:steve': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=eTpVAtfa5LQew4OdIz5m8HBJzhIjh/SduBueBOkt1vw=; b=u1jATqsClgtm/5G7LgA5BM4Fg/6AUCirSQhBA6KbQcApEqEz/tEdqtXKJGHYu54sn4 BfSCzhjVbORZC/joZI1ETd0nchoPeFd6GU8IPB9zv/9K49kO0HPNoN56bL69WAQK1RLc Bnkm8clmYJb9MmNej3mKamJXVaVLJFEEfyTxdyHRRedjb0ub3lLdPj9HaHcv01Nfz/kY MyQltIVMGvm/0jcWeqLIx1HAT36fA8aZWYMS7XzYikVXYyMDqev3Oh7ZDk80d96sADx5 RMowzy0iThwuOnp0JqH91LMIElpWKM1hIcihoJBvJNaanddxtRpbrJ744S+9UDec3rWt Pxdw== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=eTpVAtfa5LQew4OdIz5m8HBJzhIjh/SduBueBOkt1vw=; b=mOaAJjuauy+7VKwJIcBAkMr1x8ldYJJkXBcCNnZ/KKyEvrL77P5/uFV5PSdgXmt9nM SthjEIPJY1aesuVeksKBVMhH2lTgDS61lK9BUFQaT/rb067uM9XzoobajZMAsW1i02pa EB+eYqdfj16W0a3FMrLvjm32i1/V2Yn/sJpjzgt3osVVIAsOoDE+9lI9PukpJl8SA8o1 YfuHGMZabKwZ54c4B/g2EDNlbdJrv6Hu5am8m2ggJLVdxiEUvKMvYu2AUJQfg8GAgRy0 RmDknuwBQQBVoAmdO9582LvTyKJpKUkG1zEiDgRQmbXzVDlenBdTq7NOTF6jRN/jNmIQ VmYQ== |
| X-Received | by 10.181.12.80 with SMTP id eo16mr530057wid.44.1374618873971; Tue, 23 Jul 2013 15:34:33 -0700 (PDT) |
| Date | Wed, 24 Jul 2013 00:34:31 +0200 |
| From | Rafael Durán Castañeda <rafadurancastaneda@gmail.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Converting a list of lists to a single list |
| References | <ee6f5c48-6cb1-498f-813a-be2eef5411fc@googlegroups.com> |
| In-Reply-To | <ee6f5c48-6cb1-498f-813a-be2eef5411fc@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| 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.5015.1374618881.3114.python-list@python.org> (permalink) |
| Lines | 15 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1374618881 news.xs4all.nl 15964 [2001:888:2000:d::a6]:36253 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:51105 |
Show key headers only | View raw
El 23/07/13 23:52, steve@divillo.com escribió: > [[A0,A1,A2], [B0,B1,B2] [C0,C1,C2]] Hi, I think you are looking for itertools.chain, or in this case, itertools.chain.from_iterable: In [1]: x = [['A0','A1','A2'], ['B0','B1','B2'], ['C0','C1','C2']] In [2]: import itertools In [3]: [ y for y in itertools.chain.from_iterable(x)] Out[3]: ['A0', 'A1', 'A2', 'B0', 'B1', 'B2', 'C0', 'C1', 'C2'] HTH
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Converting a list of lists to a single list steve@divillo.com - 2013-07-23 14:52 -0700 Re: Converting a list of lists to a single list Rafael Durán Castañeda <rafadurancastaneda@gmail.com> - 2013-07-24 00:34 +0200 Re: Converting a list of lists to a single list MRAB <python@mrabarnett.plus.com> - 2013-07-23 23:52 +0100 Re: Converting a list of lists to a single list Zero Piraeus <schesis@gmail.com> - 2013-07-23 18:49 -0400 Re: Converting a list of lists to a single list Terry Reedy <tjreedy@udel.edu> - 2013-07-23 19:02 -0400 Re: Converting a list of lists to a single list Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-23 20:28 -0400 Re: Converting a list of lists to a single list Chris Angelico <rosuav@gmail.com> - 2013-07-24 15:40 +1000 Re: Converting a list of lists to a single list Terry Reedy <tjreedy@udel.edu> - 2013-07-24 11:56 -0400 Re: Converting a list of lists to a single list steve@divillo.com - 2013-07-24 11:11 -0700
csiph-web