Seaborn barchart for frequency of data I'm trying to plot a bar chart to represent the frequency of two variables (Dead and Alive) in my test and training data. I want it to look like the second example described in the documentation (minus the error bars).

Currently i have
yfreq = pd.DataFrame(data = [Counter(Ytrain),Counter(Ytest)],
                     index = ['Train','Test'])
yfreq.columns = ['Dead', 'Alive']
print(yfreq)
&gt;&gt;&gt;        Dead  Alive
    Train   384    239
    Test    165    103

And then for the graph
sns.barplot(data = yfreq)

Which correctly outputs a graph but does not split the data into test and training data.

I know it has something to do with the hue kwarg but i can't work out how too do it.
Thanks in advance
This should do the trick. You have to melt your data frame to use x,y and hue in your seaborn barplot.

yfreq['type'] = yfreq.index
yfreq = yfreq.melt(id_vars = 'type')
sns.barplot(x = 'variable', y = 'value', hue = 'type', data = yfreq)