Say we have used pandas dataframe[column].value_counts() which outputs:
apple 5
sausage 2
banana 2
cheese 1
How do yo
First you have to sort the dataframe by the count column max to min if it's not sorted that way already. In your post, it is in the right order already but I will sort it anyways:
dataframe.sort_index(by='count', ascending=[False])
col count
0 apple 5
1 sausage 2
2 banana 2
3 cheese 1
Then you can output the col column to a list:
dataframe['col'].tolist()
['apple', 'sausage', 'banana', 'cheese']