how to convert value_counts to dataframe code example
Example: how to get value_counts output in dataframe format
df = df.value_counts().rename_axis('unique_values').reset_index(name='counts')
print (df)
unique_values counts
0 2 3
1 1 2