Created
February 10, 2022 14:28
-
-
Save CookieBox26/377e36d2bfa26223075d85698ff95e59 to your computer and use it in GitHub Desktop.
Untitled.ipynb
残る候補のパターン(1匹の場合を除く)。
import collections
def hash_kouho(kouho):
return ','.join(sorted(list(kouho)))
d_kouho = collections.defaultdict(set)
li_kouho = []
for pokemon_input, result in results.items():
for gamen, kouho in result.items():
if len(kouho) == 1:
continue
hash_ = hash_kouho(kouho)
li_kouho.append(hash_)
d_kouho[hash_].add(pokemon_input + ' --> ' + gamen)
c = collections.Counter(li_kouho)
for v in c.most_common()[:10]:
print(v)
('デスカーン,デスバーン', 15)
('ニドリーナ,ニドリーノ', 15)
('グライガー,ブラッキー', 11)
('ラティアス,ラティオス', 11)
('サメハダー,ミツハニー', 10)
('スカタンク,ミルタンク', 10)
('アイアント,ウインディ,コイキング,ダイケンキ', 10)
('カイリキー,カイリュー', 10)
('バオッキー,バタフリー,バチンキー', 10)
('ストライク,ボスゴドラ', 10)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最後が20位までプリントされるようになっているが合っていることが保証されるのは上位5位までなのでこれはミスである。