How to sort Counter by value? – python
Other than doing list comprehensions of reversed list comprehension, is there a pythonic way to sort Counter by value? If so, it is faster than this: >>> from collections import Counter >>> x = Counter({‘a’:5, ‘b’:3, ‘c’:7}) >>> sorted(x) [‘a’, ‘b’, ‘c’] >>> sorted(x.items()) [(‘a’, 5), (‘b’, 3), (‘c’, 7)] >>> [(l,k) for k,l in … Read more