Sorry in advance for poor formatting, new to python and to posting on this site.
I use the following code to get the dataframe below:
staff=df.loc['Adults in my after school program are nice.':'I like the adults in my after school program.', 'Percent':'Performance']
Prompt Percent Performance
Adults are nice. 87 Good
Adults treat me fairly. 70 Needs Improvement
Adults listen to what I have to say. 90 Excellent
I like the adults. 80 Good
I am trying to plot it using Seaborn with this code:
fg = seaborn.FacetGrid(data=df, hue='Performance', aspect=1.61)
fg.map(plt.bar, 'Staff', 'Percent').add_legend()
fg
However, it always gives me the error
KeyError: "['Staff'] not in index"
when I try to plot. I've tested it using
'Prompt' in staff.index
which returns True
I've also tried resetting the index, but that doesn't seem to help either. Any thoughts as to what might be wrong with my code? Thanks in advance.