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


Groups > comp.lang.python > #37640 > unrolled thread

RE: Dict comp help

Started by"Joseph L. Casale" <jcasale@activenetwerx.com>
First post2013-01-24 22:21 +0000
Last post2013-01-24 22:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#37640 — RE: Dict comp help

From"Joseph L. Casale" <jcasale@activenetwerx.com>
Date2013-01-24 22:21 +0000
SubjectRE: Dict comp help
Message-ID<mailman.1022.1359066178.2939.python-list@python.org>
> >>> 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web