import pandas as pd
import pylab as plt
plt.rc('font',family='SimHei') #用来正常显示中文标签
plt.rc('font',size=16) #设置显示字体大小
a=pd.read_excel("data2_52.xlsx",header=None)
b=a.T; b.plot(kind='bar'); plt.legend(['钻石', '铂金'])
plt.xticks(range(6), b[0], rotation=0)
plt.ylabel('数量'); plt.show()
已经安装了pandas库和matplotlib库,上面的代码是我从一本教材上copy下来的(大概是不会出错),但运行之后系统报错
pandas包依赖openpyxl包,pip install openpyxl安装一下
有帮助的话,请点采纳该答案~