[Administrative note: The 7th cohort of my Python Data Analysis Bootcamp (PythonDAB) will start on June 19th! I'm holding another webinar on Sunday with info about this 4-month intense-but-intimate mentoring program in Python, Git, and Pandas. Join me on June 15th: https://us02web.zoom.us/webinar/register/WN_TgKu-kiwTVeylzMOQidTZA .]
Earlier this week, the World Bank released its latest report on "Global Economic Prospects" (https://www.worldbank.org/en/publication/global-economic-prospects), summarizing its projections for the world economy. As they write in their introduction to the report, "The world economy today is once more running into turbulence. Without a swift course correction, the harm to living standards could be deep."
Much of the turbulence, of course, stems from constant, dramatic changes in US trade policy (https://www.nytimes.com/2025/06/10/business/trump-trade-war-global-economy.html?unlocked_article_code=1.OE8.Ka6G.qniKQPkHs07f&smid=url-share). We hear about increases, decreases, pauses, and restorations of tariffs on a variety of countries and products at a rate that is hard to keep straight. The unpredictability has led numerous companies to stop providing financial forecasts. There are reports that Chinese diplomats are pressing businesses and countries to expand trade ties, with China touting itself as a more stable and predictable trading partner than the United States.
This week, we'll look at the World Bank's projections for the US and for other countries. We'll see which countries and regions have had their projections changed most (and least).
Data and five questions
This week's data comes from the World Bank. If you go to the GEP home page (https://www.worldbank.org/en/publication/global-economic-prospects) and open the "more downloads" menu at the center of the page, choose "GDP growth data." That'll download an Excel spreadsheet to your computer with the data we'll be examining.
Paid subscribers can retrieve the data file from the end of this message.
Learning goals for this week include reading from Excel files, cleaning data, multi-indexes, window functions, and plotting.
I'll be back tomorrow with my solutions and explanations.
Here are my five questions:
- Download the Excel spreadsheet with the World Bank's data, and read the first sheet it into a Pandas data frame. We only want from rows 5 through 34 in Excel. Columns A through D should all be in a four-way multi-index. We do want all of the columns with projections, as well as the differences from earlier this year (columns M and N) to be included. In the columns we'll use for the index, replace
NaN
with the previous non-NaN
value in that column. - Column M, labeled "2025f", shows the percentage point difference from January 2025 predictions. Which five countries' predictions dropped by the greatest amount since the last forecast? What countries (if any) have improved their growth forecast since January?