TypeError:不可散列的类型:'numpy.ndarray'-arima时间序列

问题描述 投票:0回答:1

试图绘制二维表但出现错误

我的表只有两列,代码是:

Combined = pd.read_csv(file_path, parse_dates=['Revenue_mth'], index_col = ['Revenue_mth'])
plt.xlabel('Date')
plt.ylabel('Revenue amount')
plt.plot(Combined)
python python-3.x pandas matplotlib
1个回答
0
投票

[Combined是数据框,您必须在plot命令中指定列。

 Combined = pd.read_csv(file_path, parse_dates=['Revenue_mth'], 
                        index_col = ['Revenue_mth'])
 plt.xlabel('Date')
 plt.ylabel('Revenue amount')
 plt.plot(Combined['Revenue_mth'],Combined['Column 2'])
 plt.show()

其中“第2列”是另一列的标题的名称。

© www.soinside.com 2019 - 2024. All rights reserved.