标签: python-3.x
如果我有
a = [['a','b','c'],['b','c','d'],['a','b','c'],['e','f','g'],['b','c','d']]
我如何获得
a = {('a','b','c'):2,('b','c','d'):2,('e','f','g'):1}
答案 0 :(得分:0)
您可以使用Counter:
from collections import Counter a = Counter(map(tuple, a))