Goal: I want to get a list of values which are unique. The list should remove duplicates and ideally should order them based on number
I have the following JSON file.
{ "words" : [{"id":598,"tags":[104,65],"langs":[1]},{"id":597,"tags":[104,65],"langs":[1]},{"id":596,"tags":[20,30],"langs":[1]}]}
Within my script I have the following code:
count = 0
tags = []
for index in data['words']:
count += 1
tags.append(index["tags"])
This will print the following code:
print tags
# result: [[104, 65], [104, 65], [20, 30]]
What I want to achieve is to get an unique list of numbers. So that I end up with this situation:
# result [20,30,65,104]
In this case the double values are removed. Can someone help me to get into this direction?