0

I was trying to plot from the dataframe, with X being the boolean and y being the mean.

df.plot(x = 'true/false', y = 'mean', kind = 'bar')

However, it returns KeyError of 'true/false'

              mean
true/false
         1     0.6
         0     0.7

And then I tried

df.column

It only returns the 'mean'

What should I do to plot?

王亦舟
  • 131
  • 1
  • 5

1 Answers1

0

Remove x and set use_index=1:

df.plot(use_index=True, y='mean', kind='bar')
Code Different
  • 90,614
  • 16
  • 144
  • 163