I\'ve tried using Counter and itertools, but since a list is unhasable, they don\'t work.
My data looks like this: [ [1,2,3], [2,3,4], [1,2,3] ]
I would like to
list = [ [1,2,3], [2,3,4], [1,2,3] ]
repeats = []
unique = 0
for i in list:
count = 0;
if i not in repeats:
for i2 in list:
if i == i2:
count += 1
if count > 1:
repeats.append(i)
elif count == 1:
unique += 1
print "Repeated Items"
for r in repeats:
print r,
print "\nUnique items:", unique
loops through the list to find repeated sequences, while skipping items if they have already been detected as repeats, and adds them into the repeats
list, while counting the number of unique lists.