问题将 DataFrame 中的数据绘制到线图中不包括 x 轴上的“日期”。north_result = list(data.aggregate(pipeline))dates =['Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May']north_result_df = pd.DataFrame(north_result, index=dates)north_result_df.index.name = 'Months'north_result_df.plot.line()问题将 DataFrame 中的数据绘制到线图中不包括 x 轴上的“日期”。north_result = list(data.aggregate(pipeline))dates =['Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May']north_result_df = pd.DataFrame(north_result, index=dates)north_result_df.index.name = 'Months'north_result_df.plot.line()
1 回答

不负相思意
TA贡献1777条经验 获得超10个赞
你可以使用 pyplot
import matplotlib.pyplot as plt
north_result =[5,6,7,2,8,5,4,8,9,4,1,5]
dates =['Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May']
north_result_df = pd.DataFrame(north_result, index=dates)
north_result_df.index.name = 'Months'
plt.plot(north_result_df)
plt.show()
结果将是这样的:
添加回答
举报
0/150
提交
取消