I am trying to create a histogram of education. However, my data is such that the edu
variable is categorical: '10', '11', '12', 'GED', etc.
. I want a histogram that goes in that order '10', '11', '12', 'GED', '13', etc.
My two approaches are:
1: Use pd.DataFrame.hist
with a new variable that maps edu
to a numeric edunum
variable. However, I am then having trouble getting the original edu
lables on the histogram
2: Use pd.Series(list(profile.['edu'])).value_counts().plot(kind="bar")
. However, I am having trouble sorting the bar order correctly.
Any suggestions? Thanks!