How do I sort a list by its frequency in Python?
For example, I have the list:
[1,2,3,4,3,3,3,6,7,1,1,9,3,2]
The above list would be sorted in the order of the frequency of its values to create the following list, where the item with the greatest frequency is placed at the front:
[3,3,3,3,3,1,1,1,2,2,4,6,7,9]