Say we have used pandas dataframe[column].value_counts() which outputs:
dataframe[column].value_counts()
apple 5 sausage 2 banana 2 cheese 1
How do yo
The best way to extract the values is to just do the following
json.loads(dataframe[column].value_counts().to_json())
This returns a dictionary which you can use like any other dict. Using values or keys.
{"apple": 5, "sausage": 2, "banana": 2, "cheese": 1}