Seaborn barplot with some complexity

You can reset_index to be able to use the columns:

a.rename('value').reset_index()

Output:

   frame col  target     value
0   test   a       0  0.333333
1   test   b       0  0.333333
2   test   b       1  0.333333
3  train   a       1  0.666667
4  train   b       1  0.333333

Note however that seaborn doesn't do stacked barplots natively, so you'll either need to use pandas plotting or change the type of plot.