我有一个pandas数据帧,类似于:
Species Count1 Count2
AGREP 2 10
GYLEP 4 6
POAPRA 2 8
EUPESU 1 11
我想画一个物种与计数1的直线图,x轴是物种,y轴是计数1。在
我试着使用代码:
^{pr2}$
但这将返回错误:
ValueError: could not convert string to float
我只想最终只选择某些物种来对付这两种情况。例如,我想在x轴上绘制AGREP
和EUPESUS
,将计数1和计数2作为y轴。不过,它不会将字符串打印为轴名。在
Tags:
您可以将这些字符串设置为索引,只需使用
^{pr2}$pandas.DataFrame
.plot
方法。在相关问题 更多 >
编程相关推荐