A little morning puzzle
Paul Rubin
no.email at nospam.invalid
Wed Sep 19 13:12:59 EDT 2012
More information about the Python-list mailing list
Wed Sep 19 13:12:59 EDT 2012
- Previous message (by thread): A little morning puzzle
- Next message (by thread): sum works in sequences (Python 3)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Neal Becker <ndbecker2 at gmail.com> writes: > 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? Untested, and uses a few more comparisons than necessary: # ds = [dict1, dict2 ... ] d0 = ds[0] ks = set(k for k in d0 if all(d[k]==d0[k] for d in ds))
- Previous message (by thread): A little morning puzzle
- Next message (by thread): sum works in sequences (Python 3)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list