I have a dataFrame and I want to plot two columns. All the examples i saw used only numbers as their values but when I try to plot a columns that has strings then I get an error. How can I plot a string columns?
我有一个dataFrame,我想绘制两列。我看到的所有示例都只使用数字作为它们的值,但是当我尝试绘制具有字符串的列时,我得到一个错误。如何绘制字符串列?
d = {'one' : np.random.rand(10),
'two' : np.random.rand(10)}
df = pd.DataFrame(d)
df.plot(style=['o','rx'])
plt.show()
DataFrame sample (I want to plot AvgTemp and StateName)
DataFrame示例(我想绘制AvgTemp和StateName)
STATION;"STATION_NAME";"LATITUDE";"LONGITUDE";"LATLONG";"AvgTemp";"MaxTemp";"MinTemp";"StateName";"Zip";"State";"Date"
GHCND:USW00094746;"WORCESTER MA US";42.2706;-71... -71.8731";55.0;58.0;47.0;"Massachusetts";1602...