Created
July 22, 2016 07:12
-
-
Save takaki/9ffff06dc32ee7b53aefc3bbc50de534 to your computer and use it in GitHub Desktop.
listから重複がある要素を探す ref: http://qiita.com/takaki@github/items/2db001df80f99031b326
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from collections import Counter | |
>>> [ k for k, v in Counter([0,1,2,3,2,0,4]).items() if v > 1 ] | |
[0, 2] | |
>>> [ k for k, v in Counter("abcefacc").items() if v > 1 ] | |
['c', 'a'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment