Photo Credit: Pixabay

A Comparison of G7 Countries House Price Movement

Python, FRED, Economic Data, Housing Price

Federal Reserve Economic Data (FRED) is an online database maintained by the Federal Reserve Bank of St. Louis that provides over 800,000 economic data series from more than 100 public and proprietary sources.

With FRED API key, you can use any programming language that can parse XML or JSON to query FRED data free of charge.

In this post, we will write Python code to retrieve and compare G7 countries’ housing price movement data for the past over 50 years.

To get started.

The Data

We now have what we need. Let’s go fetch the data.

The series id for “Real Residential Property Prices for Canada” is “QCAR628BIS”, the series start date is “1970–01–01” and end date is “2021–10–01”.

get_fred_data.py
df_canada
Table 1
plot_house_price_canada.py
Figure 1

Here we have Real Residential Property Prices data for Canada from 1970–01–01 to 2021–10–01.

With the information we have, now we are going to fetch all G7 countries housing data.

all_series_data.py
Table 2

In this series, FRED has the housing data for 51 countries. We will need G7 countries.

df_g7.py
Table 3
g7_series.py
Table 4

The last step is to add a “country” column.

df_g7_country.py
Table 5
g7_house_price_line_chart.py
Figure 2

G7 countries house prices’ long-term trend is mixed. Canada has significant appreciated over the long period of time, and the UK has been in a “weak” property market over the past 10 years. While Italy is trending down. The U.S housing market is still recovering from its “bubble”.

Jupyter notebook can be found on Github. Enjoy the rest of the week!

Sources: National sources, BIS Residential Property Price database, https://www.bis.org/statistics/pp_detailed.htm

--

--

--

Changing the world, one post at a time. Sr Data Scientist, Toronto Canada. https://www.linkedin.com/in/susanli/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Microbial Surveillance: How It Works & Why It’s Important

Hypothesis Testing — More than p-value

Self-service Business Intelligence, Powered by dbt

How to Make Stunning Interactive Maps with Python and Folium in Minutes

Web Scraping News with 4 lines using Python

RISK PROFILE PREDICTION OF A VESSEL AND ITS RESOURCE USING ML

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Susan Li

Susan Li

Changing the world, one post at a time. Sr Data Scientist, Toronto Canada. https://www.linkedin.com/in/susanli/

More from Medium

Diving into GCP’s BigQuery ML & AutoML Tables with Covid19 Big Data

How to build a Medical AI/ML Application on Kubernetes

Running ML Pipelines on Kubeflow on GCP

A generalized end to end approach to regression problems using DNNs and Bigquery