This repository contains Jupyter notebooks that visually analyze US Economic data as provided by St. Louis Fed, the OECD, and Yahoo-Finance. The analysis is carried out using Pandas, Pandas datareader, and Matplotlib.
So far I created the following notebooks (following a given link lets you see the most recent run of its notebook, I aim to refresh results monthly):
- Analysis of CPI, Fed Funds Rate, Treasury rates and Inflation expectations, plus a similar analysis for the Eurozone by way of comparison
- Analysis of the evolution of the US Federal Public Debt
- Analysis of the evolution of the ownership structure of US Federal Debt
- Analysis of changes in M2, Real Personal Consumption Expenditures (PCE), Wage Inflation and CPI
- Analysis of Participation, Employment, Unemployment, Job-vacancy, and Unfilled Vacancies to Population Rates, plus a similar analysis for the Eurozone by way of comparison
- Analysis of US Money Supply, plus a similar analysis for the Eurozone by way of comparison
- Analysis of Quantitative Easing and Tapering by the Federal Reserve
- Analysis of US Treasury Yields' Spreads
- Analysis of US Past, Current, and Future Riskfree Rates, plus a similar analysis for the Eurozone
- Analysis of US Industrial Production
- Analysis of US GDP, its composition by industry, and trends in its make-up, plus a similar analysis for the Eurozone
- Analysis of US Labor productivity (incl. comparison with that in EU)
- Analysis of disposable income and savings rates of US individuals, plus a similar analysis for the Eurozone
- Analysis of US Stock Market, including various metrics on the S&P 500 Index, plus a similar analysus for Stoxx Europe 600 Banks Index
You'll need python3 and pip. brew install python
will do if you are on MacOS. You can even forgo installing anything and run these notebooks in Google cloud, as I outline below.
In case you opt for a local installation, the rest of the dependencies can be installed as follows:
python3 -m pip install -r requirements.txt
NB: I use Yahoo-Finance data in the Current_Riskfree_Rates.ipynb
notebook. I switched fully to yfinance for working with Yahoo-Finance data due to its better maintenance and frequent new releases.
If you want to run the notebooks locally on your laptop, clone the repo and cd
into its directory, e.g.:
git clone -l -s https://github.com/ilchen/US_Economic_Data_Analysis.git
cd US_Economic_Data_Analysis
run one of the below commands depending on which notebook you are interested in:
jupyter notebook CPI_and_Fed_Funds_Rates.ipynb
or
jupyter notebook Fed_Public_Debt_and_Fed_Tax_Revenue.ipynb
or
jupyter notebook Fed_Public_Debt_Holders.ipynb
or
jupyter notebook M2_PCE_and_CPI.ipynb
or
jupyter notebook Unemployment_and_Participation_Rates.ipynb
or
jupyter notebook Money_Supply.ipynb
or
jupyter notebook Quantitative_Easing_and_Tapering.ipynb
or
jupyter notebook Interest_Rate_Spreads.ipynb
or
jupyter notebook Current_Riskfree_Rates.ipynb
or
jupyter notebook Industrial_Production.ipynb
or
jupyter notebook GDP_Composition.ipynb
or
jupyter notebook Labor_Productivity.ipynb
or
jupyter notebook Disposable_Income_and_Savings.ipynb
or
jupyter notebook Stock_Market.ipynb
You can also run these notebooks in Google cloud. This way you don't need to install anything locally. This takes just a few seconds:
- Go to Google Colaboratory in your browser
- In the modal window that appears select
GitHub
- Enter the URL of this repository's notebook, e.g.:
https://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Fed_Public_Debt_and_Fed_Tax_Revenue.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/CPI_and_Fed_Funds_Rates.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Fed_Public_Debt_Holders.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/M2_PCE_and_CPI.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Unemployment_and_Participation_Rates.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Money_Supply.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Interest_Rate_Spreads.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Current_Riskfree_Rates.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Quantitative_Easing_and_Tapering.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Industrial_Production.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/GDP_Composition.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Labor_Productivity.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Disposable_Income_and_Savings.ipynb
orhttps://github.com/ilchen/US_Economic_Data_Analysis/blob/main/Stock_Market.ipynb
- Click the search icon
- Enjoy
In some of the notebooks I make use of additional python code I developed (e.g.Current_Riskfree_Rates.ipynb
) or dependencies that are not by default provisioned in Google Colaboratory. When running these notebooks in Colaboratory, it's important to clone this repository andcd
to it. I crated a commented out cell at the beginning of these notebooks to make it easier. Please don't forget to uncomment its content and run it first. E.g. here's one fromCurrent_Riskfree_Rates.ipynb
:
# Uncomment if running in Google Colaboratory, otherwise the import of the curves module in the cell below will fail
#!git clone -l -s https://github.com/ilchen/US_Economic_Data_Analysis.git cloned-repo
#%cd cloned-repo
# Install the latest version of pandas-datareader and yfinance
# !pip install pandas-datareader -U
# !pip install yfinance -U