BW #80: Inflation
Until a few years ago, inflation seemed like a thing of the past, at least in most developed countries. Low inflation meant that central banks, and especially the Federal Reserve, could keep interest rates extremely low – at or close to zero. (This was sometimes called ZIRP, for "zero interest-rate policy," as described here: https://en.wikipedia.org/wiki/Zero_interest-rate_policy)
ZIRP meant that borrowing money was close to free, making it cheaper for consumers to borrow money, including for a mortgage. It also meant that businesses that wanted to borrow money could do so very easily. It even meant that governments could borrow for very little.
Moreover, because banks pay less interest than they charge for loans, this meant that saving money in the bank got you close to nothing. I've heard people suggest that this might have encouraged people to put their money into riskier assets, such as stocks and even cryptocurrency such as Bitcoin.
The pandemic and subsequent world events changed all that: Inflation rose for a few years, forcing central banks to raise their interest rates – making business loans and mortgages more expensive. Of course, that's how it's supposed to work; a central bank raises interest rates in the hopes that it can cool down the economy without running into recession. That ideal is often called a "soft landing," and it's considered pretty hard to pull off.
And yet, the US seems to have done so. The US economy is doing fairly well, with historically low unemployment. Even better, inflation has been coming down in the US -- so much so that there's talk of the Fed lowering interest rates at its September meeting.
The Republican party has been blaming President Joe Biden's policies for inflation in the US. Certainly some of his policies might have contributed to inflation. But the data shows US is in an overall better position than many other countries.
It's also possible that the problem is one of definitions; the word "inflation" refers to how quickly prices are changing, not to whether prices are higher than last year or several years ago. Low inflation doesn't mean that prices will return to what they were before; that's deflation, and in many ways, it's worse than inflation. Felix Salmon suggested back in May that we acknowledge that most people's use of the word "inflation" doesn't match how economists use it: https://www.axios.com/2024/05/26/inflation-definition-evolution-high-prices
This week, we'll look at inflation in the OECD. Where is it highest and lowest, and where is it changing the most?
Rather than use Pandas, as we usually do around here, we're going to use Polars for our analysis this week. Polars (https://pola.rs/) is a Pandas-like library written in Rust with a Python API. It has been gaining some mindshare over the last few years, partly because of its clean interface and partly because it runs extremely quickly. Even if you won't use Polars on a day-to-day basis, it's useful to know how to use it.
Data and six questions
This week's data come from the OECD (Organisation for Economic Co-operation and Development, https://www.oecd.org/), which the Economist calls a "club of mostly-rich countries." Among other things, the OECD collects data from its member countries, allowing us to compare them with one another -- both to better understand what's happening in those countries, and to make recommendations for how they can improve.
I downloaded the inflation data from the OECD's data explorer:
You can view and play with the data there, in your browser. But you can also download the data in CSV format, either by clicking on the "download" button, or by using this URL:
https://sdmx.oecd.org/public/rest/data/OECD.SDD.TPS,DSD_G20_PRICES@DF_G20_PRICES,1.0/all?dimensionAtObservation=AllDimensions&format=csvfilewithlabels
This week, I have six questions for you to answer, all using Polars. The learning goals are about using Polars to read, filter, and query data.
I'll be back tomorrow with my detailed answers, including the Jupyter notebook I used to solve these:
- Create a data frame from the CSV file. Keep only those columns containing
ALL CAPS
. - Remove rows in which the location is EA20, EU27_2020, or G20.