📜  按 Python 中出现的频率排序 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:06.636000             🧑  作者: Mango

代码示例1
from collections import Counter
print [item for items, c in Counter(a).most_common() for item in [items] * c]
# [5, 5, 5, 5, 3, 3, 3, 4, 4, 4, 1, 1, 2]