April 2019
Intermediate to advanced
426 pages
11h 13m
English
The closing prices of JPM having been downloaded to the pandas Series object jpm_prices earlier, simply calculate the actual percentage returns with the following code:
In [ ]: y = jpm_prices.pct_change().dropna()
We obtain a pandas Series object as our target variable y.