python - How to eliminate duplicate key value pair inside a list -


this question has answer here:

[     {'date': '08/11/2016', 'duration': 13.0},      {'date': '08/17/2016', 'duration': 5.0},      {'date': '08/01/2016', 'duration': 5.2},      {'date': '08/11/2016', 'duration': 13.0},      {'date': '08/11/2016', 'duration': 13.0},      {'date': '08/11/2016', 'duration': 13.0} ] 

if data that.

one easy not efficient solution can be:

a = [{'date': '08/11/2016', 'duration': 13.0}, {'date': '08/17/2016', 'duration': 5.0}, {'date': '08/01/2016', 'duration': 5.2}, {'date': '08/11/2016', 'duration': 13.0}, {'date': '08/11/2016', 'duration': 13.0}, {'date': '08/11/2016', 'duration': 13.0}] b = [] c in a:    if c in b:       continue    b.append(c) print(b) 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -