This is a follow-up question for a question I asked previously. The old question can be found here, I received an answer from @jezrael.
Now I want to plot the grades.
For plotting all grades I can do
counts_gardes = df1['new'].value_counts(sort=False)
counts_gardes.plot(kind='bar')
However, I could not figure out how to plot per grade group including zero counts.
counts_gardes_group = df1['new'].value_counts(sort=False)
counts_gardes_group.plot(kind='bar')
I would like to also include zero counts for F
in the plotted figures. I tried the solutions provided in here, here and here but they did not work. The first returns all grades, while the latter gives an error stating that index
does not have levels
.
Any help is really appreciated.