How do I find unique items for a list of lists?
In the following example I expect only 2 items.
mylist=[[' Dish Towel .\n', '1.000', '149.000'],
[' Dish Towel .\n', '1.000', '149.000'],
[' Kitchentowel(mix designs) .\n', '1.000', '99.000'],
[' Kitchentowel(mix designs) .\n', '1.000', '99.000']]
Expected result:
newlist=[[' Dish Towel .\n', '1.000', '149.000'],
[' Kitchentowel(mix designs) .\n', '1.000', '99.000']]
I tried this but I got TypeError.
output = set()
for x in mylist:
output.add(x)
print output