I have a data that contains suicides, year by year and country by country and more. I grouped them by age and country but by doing that i think country and age are becoming indexes and that is why I cant use them on barplot. Here is the code.
spe = df.groupby(['country','age']).sum().sort_values(by='suicides_no').xs(level='age',
key='15-24 years')
sns.barplot(x = 'country', y = 'suicides_no',data = spe)
matplotlib.pyplot.xticks(rotation=90)
I get this error:
ValueError: Could not interpret input 'country'