How it works...
In Step 2, we downloaded the data directly from prof. French's website. To do so, we used the fact that we can execute bash commands in Jupyter Notebooks by preceding them with !. First, we downloaded the file using wget and then unzipped it using unzip. There are also ways to do this in Python only, but this seemed like a good place to introduce the possibility of mixing up bash script into the Notebooks. The link to the monthly data is always the same, and the file is updated every month.
In Steps 4 to 6, we wrangled the raw data from the CSV file into a form that can be used for modeling. The file also contained annual factors located below the monthly ones, so we only kept the relevant rows (we also skipped the first three ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access