I know this is probably an easy answer but I can\'t figure it out. What is the best way in Python to keep the duplicates in a list:
x = [1,2,2,2,3,4,5,6,6,7
keepin' it simple:
array2 = [] aux = 0 aux2=0 for i in x: aux2 = i if(aux2==aux): array2.append(i) aux= i list(set(array2))
That should work