如何计算python中字典中值的出现次数
a = dict()
a['cat'] = 1
a['fish'] = 1
a['dog'] = 2
a['bat'] = 3
a['aardvark'] = 3
a['lion'] = 4
a['wallaby'] = 5
a['badger'] = 5
预期输出:
KEY Count
1 2
2 1
3 2
4 1
5 2
EDIT
抱歉,我是说计数值