Skip to content

Bamboo Weekly #181: Housing costs

Get better at: Working with CSV files, dates and times, grouping, pivot tables, cleaning, and regular expressions

Bamboo Weekly #181: Housing costs

[Administrative note: We'll have Pandas office hours tomorrow! I'll send Zoom info in a few hours. Office hours are for paid BW subscribers, but also for LernerPython+data subscribers, who can get the Zoom info on the (new!) personal calendar at https://lernerpython.com/my-account/my-calendar/. That personal calendar also has dozens of archived members-only lectures on a variety of topics.]

We all need to live somewhere -- and for many of us, that means eventually buying a home. But houses are expensive, and for many people, they have recently become even more expensive.

I heard an interview about the high cost of US housing on yesterday's Marketplace (https://www.marketplace.org/story/2026/07/28/as-mortgage-rates-stay-high-this-lender-is-seeing-buyers-accept-the-new-normal#as-mortgage-rates-stay-high-this-lender-is-seeing-buyers-accept-the-new-normal) and in a recent episode of Slate Money (https://slate.com/podcasts/slate-money/2026/07/business-your-electricity-bill-is-growing-with-a-i).

Both shows talked about the fact that there is just too little housing stock in the US. Reduced supply and increased demand will, pretty clearly, lead to higher prices.

But inflation has kept interest rates high, and those rates influence mortgage rates. Which means that if you need a mortgage to buy a home today, you're looking not only at a higher price, but at a costlier monthly payment for that same price.

I thought that it might be interesting to look at the American housing market. But then I remembered hearing that other countries were also faced with expensive housing, and thought that it might be interesting to compare the situation across the world, and see where housing prices have risen most dramatically, and where they haven't. We'll concentrate on the housing prices themselves, rather than the cost of a mortgage, partly to simplify things, and partly because every country has a different approach to mortgage lending.

Data and six questions

This week, we'll look at historical housing-price data from the Bank for International Settlements (https://bis.org), an international organization that coordinates communication and policy among central banks. They collect and publish a wide variety of data from countries around the world, including residential property prices (https://data.bis.org/topics/RPP/data).

You can export the data from the BIS site, but we want more rows than it would actually allow us to export. For that reason, I suggest just retrieving the CSV file directly from the site:

https://stats.bis.org/api/v2/data/dataflow/BIS/WS_SPP/1.0/?format=csv&labels=both

Notice several parts of this request:

The analysis comes in four different flavors, in two different axes:

Paid subscribers, both to Bamboo Weekly and to my LernerPython+data membership program (https://LernerPython.com) get all of the questions and answers, as well as downloadable data files, downloadable versions of my notebooks, one-click access to my notebooks, and invitations to monthly office hours.

Learning goals for this week include cleaning data, dates and times, grouping, plotting with Plotly, regular expressions, and built-in window functions.

Here are my six questions for this week. I'll be back tomorrow with my solutions and explanations: