NATO (the North Atlantic Treaty Organization) was established after World War II, in no small part to protect Western democracies against the Soviet Union and other Communist threats. NATO is generally seen as a great success, and has even absorbed into its ranks a number of countries that were previously part of the Soviet Bloc before they became democracies.
But NATO has also found itself challenged, in no small part in the wake of Russia's invasion of Ukraine. NATO allies are coming under pressure to spend more on defense — both from the United States, which has long funded the lion's share among NATO members, and from their own people, who see what Russia is doing in Ukraine and want to be better prepared in case they are similarly invaded.
A number of countries have already pledged to increase defense spending to 2 percent, and several have even passed laws requiring that their governments do so. As the New York Times notes (https://www.nytimes.com/live/2025/06/25/us/trump-nato-news?unlocked_article_code=1.Rk8.57Os._2tG-hkNEc42&smid=url-share), NATO countries announced that members (but not "all members") will indeed be increasing their defense spending even further.
Given this week's NATO summit, our topic this week is thus NATO spending.
Data and five questions
This week's data comes from NATO itself, on its "Defence expenditures and NATO’s 2% guideline" page (https://www.nato.int/cps/en/natohq/topics_49198.htm). At the bottom of the page, you'll find links to download reports from each year; you want the 2024 data, at https://www.nato.int/cps/en/natohq/news_226465.htm.
Learning goals for this week include: Working with Excel files, cleaning data, window functions, regular expressions, and plotting.
Paid subscribers can download the data file from the end of this post.
Here are the five questions and tasks:
- Read the "defence expenditure" data from "table 2" into a Pandas data frame. (We want the first table on that sheet, with current prices and exchange rates.) Which five countries have increased their NATO spending most, as a percentage, in the latest budget cycle (from 2023-2024)? Which increased most since 2014, when the data was first tracked?
- The United States spends more on defense than any other NATO country, with Germany and the UK in the 2nd and 3rd position. Find how much the US spent (estimated) in 2024. Then see how many other NATO countries' defense spending, starting with Germany and the UK and continuing from largest to smallest, would be needed to match US defense spending. That is, if we'd like to say that "the US spends as much as the n next-largest contributors, combined," what is n?