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


Groups > comp.lang.python > #37640

RE: Dict comp help

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jcasale@activenetwerx.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.033
X-Spam-Evidence '*H*': 0.95; '*S*': 0.01; 'needed,': 0.05; 'everyone!': 0.07; 'subject:help': 0.07; 'received:172.18.0': 0.16; "{'a':": 0.16; 'certainly': 0.17; '>>>': 0.18; 'header:In- Reply-To:1': 0.25; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'charset:windows-1256': 0.61; 'received:unknown': 0.63; 'subject:comp': 0.96
X-Cloudmark-SP-Filtered true
X-Cloudmark-SP-Result v=1.1 cv=qT60hWcJq2tKMlwzTlfV91MSQCJjCwg5oP07qu3o0oU= c=1 sm=1 a=P90J6pEA2ccA:10 a=7PYXob_7ZXMA:10 a=BLceEmwcHowA:10 a=eoNxP8pz9j0A:10 a=xqWC_Br6kY4A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=jpLQXs3PA-3aM1gv9I8A:9 a=RFXaeJp-pwgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
From "Joseph L. Casale" <jcasale@activenetwerx.com>
To Python ‎[python-list@python.org]‎ <python-list@python.org>
Subject RE: Dict comp help
Thread-Topic Dict comp help
Thread-Index AQHN+nSpzyWBdtr5P0a8ac9F4riuJphY/gPRgAAPEcE=
Date Thu, 24 Jan 2013 22:21:44 +0000
References <kds8o9$4v0$1@ger.gmane.org>
In-Reply-To <kds8o9$4v0$1@ger.gmane.org>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [172.18.0.4]
Content-Type text/plain; charset="windows-1256"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
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.1022.1359066178.2939.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359066178 news.xs4all.nl 6946 [2001:888:2000:d::a6]:49109
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37640

Show key headers only | View raw


> >>> data = [{'a': 'xx', 'b': 'yy', 'c': 'zz'},  {'a': 'dd', 'b': 'ee', 'c': 'ff'}] 
> >>> {d["a"]: d["c"] for d in data}
> {'xx': 'zz', 'dd': 'ff'}


Priceless,
That is exactly what I needed, for which I certainly over complicated!


Thanks everyone!
jlc

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


Thread

RE: Dict comp help "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-01-24 22:21 +0000

csiph-web