I have a list of dicts, and I\'d like to remove the dicts with identical key and value pairs.
For this list: [{\'a\': 123}, {\'b\': 123}, {\'a\': 123}]<
[{\'a\': 123}, {\'b\': 123}, {\'a\': 123}]
Other answers would not work if you're operating on nested dictionaries such as deserialized JSON objects. For this case you could use:
import json set_of_jsons = {json.dumps(d, sort_keys=True) for d in X} X = [json.loads(t) for t in set_of_jsons]