Python 如果没有列标题,如何索引值?

Python 如果没有列标题,如何索引值?,python,pandas,Python,Pandas,我试图从数据框中绘图,X是布尔值,y是平均值 df.plot(x = 'true/false', y = 'mean', kind = 'bar') 但是,它返回'true/false'的KeyError mean true/false 1 0.6 0 0.7 然后我试着 df.column 它只返回“平均值” 我应该如何绘图?删除x并设置使用索引=1: df.plot(use_index=True, y='m

我试图从数据框中绘图,X是布尔值,y是平均值

df.plot(x = 'true/false', y = 'mean', kind = 'bar')
但是,它返回'true/false'的KeyError

              mean
true/false
         1     0.6
         0     0.7
然后我试着

df.column
它只返回“平均值”


我应该如何绘图?

删除
x
并设置
使用索引=1

df.plot(use_index=True, y='mean', kind='bar')