BW #58: NATO

Which NATO countries budget the most (and least) for their military? When did countries join NATO? And do the most veteran countries typically spend the most?

BW #58: NATO

NATO, the North Atlantic Treaty Alliance (https://nato.int), was formed in 1949, at the start of the Cold War. The Soviet Union was threatening to expand into Europe, and NATO was a way for liberal democracies to help one another stave off any such threats. NATO initially had 12 members, but it has expanded over the years to include 32 countries.

Two of these countries joined in just recently: Finland joined in March 2023, and Sweden joined just earlier this month. Both countries did so in reaction to Russia's invasion of Ukraine in 2022. One of the core ideas in NATO is that a country on any member is a country on all of them. While each country maintains its own military, there are frequent joint exercises, with the idea being that they will join forces as necessary to stop any foreign invasion or attack.

I've frequently heard NATO described as the most effective military alliance in history. Not only did it push back against the Soviet Union, but has it integrated numerous former Communist countries in its ranks. Moreover, it's also a key player in the world of cyber security, an important aspect of modern warfare. (The book "The Perfect Weapon: War, Sabotage, and Fear in the Cyber Age" by David Sanger was equal parts fascinating and chilling. I highly recommend it.)

The strengthening and expansion of NATO is an obvious blow to Russia, and to Vladimir Putin. But he's not the only person who has been complaining about NATO. Donald Trump has often said bad things about NATO; while he was president, he said that countries needed to pay more for NATO. (Not that this is how NATO works, but never mind.) More recently, on the campaign trail, Trump said that if he were re-elected, and if Russia were to attack a NATO ally that hadn't spent sufficiently on its military, he would encourage Russia to "do whatever the hell they want."

This week, we'll look at NATO membership and defense spending, learning about the history of the alliance and its members.

Data and eight questions

This week's data largely comes from the World Population Review (https://worldpopulationreview.com), a site that has the data we want, but which seemed a bit sketchy when I found it. That said, the "Media Bias/Fact Check" site's review of World Population Review (https://mediabiasfactcheck.com/world-population-review/) indicated that it's pretty reliable. We'll use it here this week, but it could be that some of these numbers are off.

The data itself is a bit annoying to download. First, go to the "NATO spending" page:

https://worldpopulationreview.com/country-rankings/nato-spending-by-country

We're interested in downloading the CSV version of the table of data, displayed right above the FAQs toward the lower part of the page. Click on the word "CSV" at the top of the page. Enter your e-mail address and agree to get spam (er, marketing) from them, and then you'll get the file sent to you via e-mail.

Or... because I love my subscribers, I've taken the liberty of downloading the file and made it available via Google Drive:

https://drive.google.com/file/d/1x9iWLTfCpxqrDWrc_CwCvL529dCOg0pT/view?usp=sharing

But wait! We'll also look at NATO data from this page on Wikipedia:

https://en.wikipedia.org/wiki/Member_states_of_NATO

This week's learning goals include text manipulation, plotting, working with time-series data, and joins. As usual, I'll be back tomorrow with my full explanations, including my Jupyter notebook.

Here, then, are my eight tasks and questions for you to answer:

  • Turn the CSV file from the World Population Report into a data frame. Use the country names as the data frame's index. Remove the "total" row.
  • Which five countries, in 2023, spent the most on NATO (i.e., their militaries) as a percentage of GDP? Which five countries spent the most in absolute dollars? And which five spent the most per capita?