リストの中で最も出現回数の多い要素を取り出す[collection.Counter]
elems = ["a", "a", "a", "b", "b", "c"] c = collections.Counter(elems) l = list(c.keys()) selected = l[0] print(selected) >> a
画像処理や自然言語処理などのハマりどころをまとめます
elems = ["a", "a", "a", "b", "b", "c"] c = collections.Counter(elems) l = list(c.keys()) selected = l[0] print(selected) >> a
ディスカッション
コメント一覧
まだ、コメントがありません