Photo Credit: Pixabay

A Comparison of G7 Countries House Price Movement

Python, FRED, Economic Data, Housing Price

Susan Li
3 min readJun 21, 2022

--

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

--

--

Susan Li

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