Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29485 > unrolled thread
| Started by | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| First post | 2012-09-19 14:13 +0200 |
| Last post | 2012-09-19 14:13 +0200 |
| 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: A little morning puzzle Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2012-09-19 14:13 +0200
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| Date | 2012-09-19 14:13 +0200 |
| Subject | Re: A little morning puzzle |
| Message-ID | <mailman.912.1348056865.27098.python-list@python.org> |
On 19-09-12 13:17, Neal Becker wrote: > I have a list of dictionaries. They all have the same keys. I want to find the > set of keys where all the dictionaries have the same values. Suggestions? common_items = reduce(opereator.__and__, [set(dct.iteritems()) for dct in lst]) common_keys = set([item[0] for item in common_items]) -- Antoon Pardon
Back to top | Article view | comp.lang.python
csiph-web