I'm trying to build a pygal bar chart from a pandas DataFrame series onto which .value_counts()
is applied e.g. without having to split the series into multiple columns and add those columns individually, as suggested in the documentation and this question.
import pandas as pd
import pygal
df = pd.DataFrame.from_dict({'categorical': ['foo','foo','bar','foo','bar','too']})
series = df.categorical.value_counts()
series
> foo 3
bar 2
too 1
Ideally the result looks like the plot in the solution to this question. Can this be done?
Thanks in advance!