import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.tsa.stattools import adfuller, acf, pacf
from statsmodels.graphics.tsaplots import plot_acf,plot_pacf
from statsmodels.stats.diagnostic import acorr_ljungbox
import itertools
import numpy as np
import seaborn as sn
# 读入数据
df = pd.read_csv('D:\Download\BitCoin.csv',nrows=40000)
df['Timestamp'] = pd.to_datetime(df['Timestamp'],unit='s')
pd.set_option('display.max_rows', 100)
a = df[df['Open'].isnull()==False]
a= a.set_index('Timestamp')
# 画图
plt.plot(a['Open'])
plt.xticks(rotation=70)
# 判断稳定性
def testStationarity(timeSer):
stationarity = False
dftest = adfuller(timeSer)
dfoutput = pd.Series(dftest[:4
python-ARIMA
最新推荐文章于 2024-07-28 11:34:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)