> ## Content Index
> Fetch the complete content index at: https://www.bambooweekly.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Bamboo Weekly #62: Economic report card
- URL: https://www.bambooweekly.com/bw-62-economic-report-card/
- Published: 2024-04-17T15:01:17.000Z
- Updated: 2026-08-06T10:45:22.000Z
- Description: Get better at: Excel, missing values, multi-index, regular expressions, web scraping, string operations, plotting, and grouping
- Author: Reuven M. Lerner
- Tags: excel, missing-data, multi-index, regular-expressions, web-scraping, strings, plotting, grouping

The world economy continues to be rattled by ... well, by lots of different things, including continued echoes from the covid-19 pandemic and regional instability. But are things really that bad? How much should we worry?

Earlier this week, the International Monetary Fund (IMF, [https://imf.org](https://imf.org/?ref=bambooweekly.com)) released its latest report and predictions regarding the state of the world economy. You can read the full report, or just an executive summary from the report's home page, here:

[https://www.imf.org/en/Publications/WEO/Issues/2024/04/16/world-economic-outlook-april-2024](https://www.imf.org/en/Publications/WEO/Issues/2024/04/16/world-economic-outlook-april-2024?ref=bambooweekly.com)

I thought that it would be interesting to look at the data they provided, and understand their analysis and predictions. We'll especially look at G20 countries, to see who is doing better (and worse) at handling economic issues on a variety of fronts.

### Data and seven questions

This week, we'll look at the data that the IMF provides on this page:

[https://www.imf.org/en/Publications/WEO/weo-database/2024/April/download-entire-database](https://www.imf.org/en/Publications/WEO/weo-database/2024/April/download-entire-database?ref=bambooweekly.com)

This includes information about all of the countries, measurements, and years that the IMF analyzes and discusses in their report. The Web site claims that the file is in tab-delimited CSV format, but let's just say that this isn't true.

This week's learning goals include: Handling stubborn files, working with multi-indexes, grouping, and plotting.

Here are my seven tasks and questions for this week:

- Download the full database from the IMF. If you're like me, you'll find that you have to jump through a number of hoops in order to get it loaded into Pandas. (I've never seen anything like this before, to be honest, and I'm surprised that the IMF distributed such a weird file.) Create the data frame such that it has a multi-index made up of the "Country" and "Subject Descriptor" columns, and the dtype of every column with a year heading is a float type.
- Which five countries had the lowest inflation (i.e., "Inflation, average consumer prices" where the units are "Percent change") in 2023? (Is that necessarily good?) Which countries had the highest inflation in 2023?
- Create a list, series, or NumPy array containing the names of G20 countries. One good source is [https://en.wikipedia.org/wiki/G20](https://en.wikipedia.org/wiki/G20?ref=bambooweekly.com), which lists them all. Remember that the G20 has 19 country members. plus two unions of countries – the European Union and the African Union. Remove any extraneous characters.
- Among members of the G20, who had the lowest inflation rate in 2023? Who had the highest?
- Create a bar plot showing all G20 members' inflation rates from 2019 through 2023, with one cluster of bars per country and one bar per year. If the plot gets unreadable due to outlier values, remove that outlier before plotting. Sort by 2023 inflation figures. Does any year stick out in particular? Why?
- For each country in the G20, calculate the "misery index" ([https://en.wikipedia.org/wiki/Misery\_index\_(economics)](https://en.wikipedia.org/wiki/Misery%5Findex%5F%28economics%29?ref=bambooweekly.com)), the combination of inflation and unemployment. Create a bar plot, again showing the years 2019-2023 for each country, and sorted by the misery-index calculation for each country.
- Finally, let's look at the predicted change in GDP for G20 countries this year. Grab the "Gross domestic product, constant prices" descriptor with "Percent change" for 2024\. Which countries will grow the least? Which will grow the most?

I’ll be back tomorrow with my detailed solutions.

Reuven