A little morning puzzle

Jussi Piitulainen jpiitula at ling.helsinki.fi
Wed Sep 19 07:34:41 EDT 2012


Neal Becker 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?

Literally-ish:
{ key for key, val in ds[0].items() if all(val == d[key] for d in ds) }



More information about the Python-list mailing list