You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
492 B
Python
19 lines
492 B
Python
1 year ago
|
from statsmodels.tsa.x13 import x13_arima_analysis
|
||
|
import pandas as pd
|
||
|
import os
|
||
|
# 读取时间序列数据
|
||
|
data = pd.read_excel('./江苏省日电量数据.xlsx', index_col='pt_date', parse_dates=True)
|
||
|
data = data['power_sal']
|
||
|
|
||
|
# 调用X12-ARIMA模型进行季节性调整和预测
|
||
|
result = x13_arima_analysis(data)
|
||
|
|
||
|
# 输出调整后的时间序列数据
|
||
|
adjusted_data = result.seasadj
|
||
|
|
||
|
# 输出预测结果
|
||
|
forecasts = result.forecasts
|
||
|
|
||
|
# 打印结果
|
||
|
print(adjusted_data)
|
||
|
print(forecasts)
|