import pandas as pd
dataFrame = pd.read_csv(‘dow_jones_index.data’,parse_dates=[“date”], index_col=“date”)
dataFrame.head()
#step 2
Run the below cell to filter the opening price related to stock ‘WMT’.The sample is returned to variable ‘open_WMT_Ts’
open_WMT_Ts = dataFrame[(dataFrame.stock == ‘WMT’)].open.str.replace(’$’,’ ').astype(float)
#step 3
- from statsmodels import adfuller method
from statsmodels.tsa.stattools import adfuller
#step 4 - perform stationarity check on WMT opening price using adfuller method and return the result to variable ‘tsResult’
###Start code here
tsResult =
###End code
#step 5
print(‘ADF Statistic: %f’ % tsResult[0])
print(‘p-value: %f’ % tsResult[1])
for key, value in tsResult[4].items():
print(’\t%s: %.3f’ % (key, value))
#step 6
ADF_stat =
step 7
from test_ts_wmt import values
values.save_ans1(ADF_stat)