Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- def frequency_sort(items):
- a = [list(key for i in range(value)) for key, value in Counter(items).items()]
- b = Counter(items)
- print (b)
- print (a)
- return [val for sublist in a for val in sublist]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement