ValueError:无法将字符串转换为浮点数:'Jan'

时间:2021-07-21 12:52:17

标签: python valueerror

当我运行此代码时,我似乎无法修复 valueError 代码。它确实像第一次尝试一样,也许这是一个奇迹,但现在它不能完全起作用。我该如何解决?

x = Weather.index.tolist()
y1 = Weather['Snowfall'].tolist()
y2 = Weather['Temperature'].tolist()
y3 = Weather['Rainfall'].tolist()

plt.plot(x, y1, '-s', label = "Snowfall (in 0.1*m)")
plt.plot(x, y2, '-*', label = "Temperature (in $\,^{\circ}\mathrm{C}$)")
plt.plot(x, y3, '-o', label = "Rainfall (in 0.1*cm)")

plt.title('Average Temperature, Snowfall and Rainfall in United States(1961-1990)')
plt.legend(frameon=False)

[plt.gca().spines[loc].set_visible(False) for loc in ['top', 'right']]
plt.show()

0 个答案:

没有答案