I am trying to use pandas.Series.value_counts to get the frequency of values in a dataframe, so I go through each column and get values_count , which gives me a series:
Extract keys and values for the dictionary from your_column and then zip it together.
values = df['your_column'].value_counts(dropna=False).keys().tolist() counts = df['your_column'].value_counts(dropna=False).tolist() value_dict = dict(zip(values, counts))