As someone here pointed me out, for getting the max duplicated item in a list this can be used:
>>> from collections import Counter
>>> mylist = [20, 20, 25, 25, 30, 30]
>>> max(k for k,v in Counter(mylist).items() if v>1)
30
but, what if i want to get the indexes instead of the values, being here [4, 5]
any help??
Regards…
1 Answer