I have a list of lists that looks like this:
animal_groups = [['fox','monkey', 'zebra'], ['snake','elephant', 'donkey'],['beetle', 'mole', 'mouse'],['fox','monkey', 'zebra']]
What is the best way to remove duplicate lists? Using the above example, I am looking for code that would do this:
uniq_animal_groups = [['fox','monkey', 'zebra'], ['snake','elephant', 'donkey'],['beetle', 'mole', 'mouse']]
At first I thought I could use set() , but this does not seem to work in a list of lists. I also saw an example using itertools , but the code is not entirely clear to me. Thanks for the help!
drbunsen
source share