I was trying to figure out exactly what the following expression means:
print 'Results of Dickey-Fuller Test:'
dftest = adfuller(timeseries, autolag='AIC')
dfoutput = pd.Series(dftest[0:4], index=['Test Statistic','p-value','#Lags Used','Number of Observations Used'])
for key,value in dftest[4].items():
dfoutput['Critical Value (%s)'%key] = value
print dfoutput
More specifically what does this [0:4] represent?
im not sure exactly what kind of variable dftest is but ill go through each variable so you might get a better understanding of [0:4]
Suppose you had an array like array = [1,2,3,4,5] and you did print(array[0:2]) this will print [1,2]
On the other hand you could have a string which could be word = "awesomeness" and when you print print(word[2:6]) you will get esom hope this helped!:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With