Exercise

How About Stock Returns?

In the last exercise, you showed that Amazon stock prices, contained in the DataFrame AMZN follow a random walk. In this exercise. you will do the same thing for Amazon returns (percent change in prices) and show that the returns do not follow a random walk.

Instructions

100 XP
  • Import the adfuller module from statsmodels.
  • Create a new DataFrame of AMZN returns by taking the percent change of prices using the method .pct_change().
  • Eliminate the NaN in the first row of returns using the .dropna() method on the DataFrame.
  • Run the Augmented Dickey-Fuller test on the 'Adj Close' column of AMZN_ret, and print out the p-value in results[1].