Chart of the Week: Central Government Debt in the World

A weekly series of quick random charts made in Python 🐍

The chart of this week is a Choropleth map showing the Central Government Debt as a percentage of GDP. That is, the total stock of debt liabilities issued by the central government as a share of GDP. The original map and data source is the IMF website.

What is central government debt?

Central government debt is a measure of a country’s financial position. The amount of government debt today is due to the country’s economic history, to the existence of wars and financial crises and to the way in which demographic developments have gone.

Central government debt also reflects the trade-offs between different long-term economic policy objectives, such as the distribution of prosperity between generations, socio-economic efficiency and fiscal sustainability. 

Swedish National Debt Office

Central government debt over the last 20 years

African countries are no longer the ones with the highest debt

🔶 In 1999, the countries with the highest debt were concentrated in the African continent.

ContinentCountryCentral Debt as % of GDP in 1999
Africa🇸🇹São Tomé and Príncipe526.18
Africa🇨🇩Congo, Republic of 206.32
Africa🇸🇩Sudan160.49
Africa🇸🇨Seychelles159.79
Asia🇸🇾Syria147.67
Africa🇸🇱Sierra Leone146.14
AfricaGuinea-Bissau145.15
Asia🇲🇲Myanmar144.56
Africa🇧🇮Burundi140.64
Africa🇦🇴Angola137.83

🔶 In 2009, there were still 5 African countries in the top 10 but only 2 of them (Guinea-Bissau and Seychelles) belonged to the top 10 in 1999 and remained in this list by 2009.

ContinentCountryCentral Debt as % of GDP in 2009
Africa🇪🇷Eritrea206.89
Asia🇯🇵Japan159.85
AfricaGuinea-Bissau148.26
America🇯🇲Jamaica145.21
Africa🇱🇧Lebanon144.50
Europe🇬🇷Greece125.68
Africa🇱🇷Liberia123.57
Europe🇮🇹Italy109.80
Asia🇸🇬Singapore106.40
Africa🇸🇨Seychelles106.12

🔶 By 2019, the top 10 is no longer dominated by African countries. There are the same number of African and European nations in the list and the country with the highest central debt is Japan.

ContinentCountryCentral Debt as % of GDP in 2019
Asia🇯🇵Japan201.39
Africa🇸🇩Sudan200.37
Europe🇬🇷Greece189.92
Africa🇪🇷Eritrea189.35
Africa🇱🇧Lebanon174.48
Europe🇨🇾Cyprus135.34
Europe🇮🇹Italy130.59
Asia🇸🇬Singapore129.29
AfricaCabo Verde124.98
Europe🇵🇹Portugal120.67

🔶 We can see this change clearly when plotting the change in central government debt over the last 20 years. Take a look at this interactive map (made with Plotly). Nations which acquired more debt are in purple tones while nations which managed to decrease their debt are shown in green tones. What patterns do you see?

Python Code

# Author: @QuantGirl
# Title: Central Govermenment Debt as a percentage of GDP
# Data Source: IMF https://www.imf.org/external/datamapper/CG_DEBT_GDP@GDD/CHN/FRA/DEU/ITA/JPN/GBR/USA/SWE/RUS/CAN
# Type: Map

import os.path
import geopandas as gpd
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.colors import ListedColormap

cmap_imf = ListedColormap(['#d48639',
                           '#436c7c',
                           '#7eb25b',
                           '#1c9352',
                           '#0f724d'])

world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world = world[(world.name != "Antarctica")]

imf = pd.read_excel('Data/imf-dm-export-20210930.xls', sheet_name='CG_DEBT_GDP', na_values="no data")
df = pd.merge(world, imf, left_on='name', right_on='Central Government Debt (Percent of GDP)', how='left')


def draw_map(data=df, year=2019):
    fig, ax = plt.subplots(figsize=(18, 10), frameon=True, tight_layout=True, facecolor='snow')

    data.plot(column=year, ax=ax,
              legend=True,
              missing_kwds={'color': 'lightgrey'},
              cmap=cmap_imf,
              scheme='user_defined',
              classification_kwds={'bins': [25, 50, 75, 100]})

    ax.spines[['top', 'bottom', 'right', 'left']].set_visible(False)
    ax.axis('off')

    leg = ax.get_legend()
    leg.set_bbox_to_anchor((0., 0., 0.2, 0.2))
    leg.get_texts()[0].set_text('less than 25%')
    leg.get_texts()[1].set_text('25% - 50%')
    leg.get_texts()[2].set_text('50% - 75%')
    leg.get_texts()[3].set_text('75% - 100%')
    leg.get_texts()[4].set_text('100% or more')
    leg.get_texts()[5].set_text('no data')

    ax.annotate('Central Government Debt',
                xy=(0.1, 0.9), xycoords='figure fraction',
                horizontalalignment='left', verticalalignment='top',
                fontsize=18,
                fontname='PT Serif Caption')

    ax.annotate('as a Percent of GDP - ' + str(year),
                xy=(0.1, 0.86), xycoords='figure fraction',
                horizontalalignment='left', verticalalignment='top',
                fontsize=16,
                fontname='PT Serif Caption')

    ax.annotate('Source: IMF',
                xy=(0.1, .08), xycoords='figure fraction',
                horizontalalignment='left', verticalalignment='top',
                fontsize=12, color='#555555')

    ax.annotate('@QuantGirl',
                xy=(0.9, .08), xycoords='figure fraction',
                horizontalalignment='right', verticalalignment='top',
                fontsize=16, color='#a70684',
                fontname='PT Serif Caption')

    plt.subplots_adjust(top=1, bottom=0.0, left=0.05, right=0.95)
    plt.show()

    return fig


draw_map()
Quant Girl

I write about Mathematics, Statistics, Finance, Programming, and the relationships among them. I enjoy learning, listening to music and podcasts, practicing yoga, reading magazines, and watching documentaries.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.