假设我有一本字典如下
d = {1: 7, 2: 8, 3: 9, 4: 7, 5: 8, 6: 9, 7: 7, 8: 8, 9: 9, 10: 9}
如何获取按降序排序的最常见值的字典?
所以我会期待
res = {9: 4, 8: 3, 7: 3}
假设我有一本字典如下
d = {1: 7, 2: 8, 3: 9, 4: 7, 5: 8, 6: 9, 7: 7, 8: 8, 9: 9, 10: 9}
如何获取按降序排序的最常见值的字典?
所以我会期待
res = {9: 4, 8: 3, 7: 3}