I have a multiindex pandas dataframe that looks like this:
cis-aconitate cis-aconitate +1 ... cis-aconitate +5 cis-aconitate +6
GROUP ...
mean ADE 1.481639 0.696184 ... 0.193380 0.018597
VEH 1.000000 1.000000 ... 1.000000 1.000000
std ADE 0.307211 0.209418 ... 0.114939 0.020461
VEH 0.573162 0.412895 ... 0.384928 0.752999
With indexing like this:
MultiIndex([('mean', 'ADE'),
('mean', 'VEH'),
( 'std', 'ADE'),
( 'std', 'VEH')],
names=[None, 'GROUP'])
I am trying to create a barplot of the mean values on the y-axis. Using df.unstack() and then df.plot.bar() I can get this:
But what I would ultimately like is to have the means only, with 'cis-aconitate, cis-aconitate +1 ...' across the x-axis, grouped into ADE and VEH (one color each) and then 'std' values used for the error bars. This is proving surprisingly tricky. Can anyone help? Thanks in advance!