on-internet
← Community

how to uniqify a list of dict in python

Stack Overflow ·

I have a list: d = [{'x':1, 'y':2}, {'x':3, 'y':4}, {'x':1, 'y':2}] {'x':1, 'y':2} comes more than once I want to remove it from the list.My result should be: d = [{'x':1, 'y':2}, {'x':3, 'y':4} ] Note: list(set(d)) is not working here throwing an error.

Comments

Sign in or sign up to comment and upvote.

No comments yet.