赞
踩
import os, pandas as pd
from matplotlib import pyplot
import matplotlib.pyplot as plt
#Change this to match your directory where the file is stored
os.chdir(r'Z:\\My Documents')
#Read the CSV into Python, setting the first column as the index and the first row as the column names
series = pd.read_csv('Energy.csv', header=0,index_col = 0)
series = series.transpose()
x = series.columns
print(series.head())
name = series.index.values
plt.figure(figsize = (11.69,8.27))
for i,values in enumerate(series.values):
plt.bar(x,values, label = name[i])
plt.xlabel(label = "VOC", loc = 'best')
plt.ylabel(label = "VOC", loc = 'best')
plt.legend(loc = 'best')
大家好
我试着运行上面的代码,它一直在说:
^{pr2}$
我移动了位置论证,但它仍然抛出错误。在
有什么想法吗?在
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。