Skip to content

Instantly share code, notes, and snippets.

@siroken3
Created May 24, 2019 15:54
Show Gist options
  • Save siroken3/beb8221b1a3402687be0982720358079 to your computer and use it in GitHub Desktop.
Save siroken3/beb8221b1a3402687be0982720358079 to your computer and use it in GitHub Desktop.
import collections
a = [1,1,2,3,3,3,5,5,5]
counter = collections.Counter(a)
[value for (value, count) in counter.items() if count > 1]
# [1, 3, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment