Har*_*nan 6 python matplotlib pandas
我在python中有以下数据帧
Sex Survived
0 female 0.742038
1 male 0.188908
Run Code Online (Sandbox Code Playgroud)
我想绘制直方图,其中男性和女性是x轴中的两个值,y轴具有其对应的值.知道怎么样?.我是matplotlib和pandas的新手,所以请帮忙
在我看来,你需要DataFrame.plot.bar:
df.plot.bar(x='Sex', y='Survived')
Run Code Online (Sandbox Code Playgroud)
因为histogram数值数据的情节分布.