Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37640 > unrolled thread
| Started by | "Joseph L. Casale" <jcasale@activenetwerx.com> |
|---|---|
| First post | 2013-01-24 22:21 +0000 |
| Last post | 2013-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.
RE: Dict comp help "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-01-24 22:21 +0000
| From | "Joseph L. Casale" <jcasale@activenetwerx.com> |
|---|---|
| Date | 2013-01-24 22:21 +0000 |
| Subject | RE: 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
Back to top | Article view | comp.lang.python
csiph-web