📌  相关文章
📜  计算元素的出现次数 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:57.207000             🧑  作者: Mango

代码示例1
from collections import Counter
data= [96,95,96,87,87,88,56,57,57]
occurences = Counter(data)
print(occurences)
---------------
Counter({96: 2, 87: 2, 57: 2, 95: 1, 88: 1, 56: 1})