Net bilateral aid flows from DAC donors, Denmark (current US$)

Source: worldbank.org, 01.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 37,619,999 -65.2% 6
Albania Albania 0 -100% 70
Argentina Argentina 460,000 +31.4% 54
Armenia Armenia 420,000 +425% 57
Burundi Burundi 670,000 +86.1% 52
Benin Benin 860,000 +110% 49
Burkina Faso Burkina Faso 27,170,000 -34.6% 10
Bangladesh Bangladesh 15,060,000 -31.5% 16
Bosnia & Herzegovina Bosnia & Herzegovina 0 -100% 70
Belarus Belarus 0 -100% 70
Bolivia Bolivia 1,350,000 +111% 44
Brazil Brazil 1,930,000 +468% 41
Central African Republic Central African Republic 2,270,000 -17.8% 37
China China 1,130,000 +176% 46
Côte d’Ivoire Côte d’Ivoire 110,000 65
Cameroon Cameroon 1,400,000 +2.94% 43
Congo - Kinshasa Congo - Kinshasa 440,000 -78.8% 56
Congo - Brazzaville Congo - Brazzaville 10,000 -90.9% 69
Colombia Colombia 2,000,000 +98% 40
Djibouti Djibouti 450,000 -60.9% 55
Algeria Algeria 210,000 -61.1% 62
Egypt Egypt -2,850,000 -18.3% 73
Ethiopia Ethiopia 67,589,996 +2.64% 2
Georgia Georgia 2,450,000 +185% 36
Ghana Ghana 3,350,000 -56.1% 30
Guinea Guinea 0 -100% 70
Equatorial Guinea Equatorial Guinea 0 70
Guatemala Guatemala 1,430,000 +123% 42
Honduras Honduras 800,000 +700% 51
Indonesia Indonesia 8,720,000 +129% 22
India India 20,180,000 +210% 14
Iran Iran 3,220,000 +6.98% 31
Iraq Iraq 10,410,000 +0.386% 20
Jordan Jordan 13,950,000 +181% 18
Kenya Kenya 53,540,001 +1.61% 5
Kyrgyzstan Kyrgyzstan -150,000 -53.1% 71
Cambodia Cambodia 2,750,000 +26.7% 33
Laos Laos 100,000 -80.8% 66
Lebanon Lebanon 26,129,999 -16.8% 13
Liberia Liberia 330,000 -63.7% 58
Libya Libya 1,120,000 -55.6% 47
Sri Lanka Sri Lanka 150,000 +150% 63
Morocco Morocco 3,490,000 +41.3% 28
Moldova Moldova 6,230,000 +62,200% 25
Madagascar Madagascar 470,000 +683% 53
Mexico Mexico 840,000 +320% 50
North Macedonia North Macedonia 40,000 +33.3% 67
Mali Mali 28,680,000 -68% 9
Myanmar (Burma) Myanmar (Burma) 11,260,000 -49.8% 19
Mozambique Mozambique 1,250,000 -58.6% 45
Mauritania Mauritania 0 -100% 70
Malawi Malawi 2,230,000 -19.2% 38
Malaysia Malaysia 0 -100% 70
Niger Niger 19,910,000 -37.6% 15
Nigeria Nigeria 7,840,000 +171% 23
Nicaragua Nicaragua 30,000 -70% 68
Nepal Nepal 3,440,000 +7.17% 29
Pakistan Pakistan 9,410,000 +69.9% 21
Panama Panama 30,000 -103% 68
Peru Peru 0 -100% 70
Philippines Philippines 2,500,000 +363% 35
Palestinian Territories Palestinian Territories 26,350,000 +34.5% 11
Rwanda Rwanda 260,000 -95.9% 60
Sudan Sudan 6,130,000 -66.5% 26
Sierra Leone Sierra Leone 120,000 -91.3% 64
El Salvador El Salvador 280,000 -31.7% 59
Somalia Somalia 36,860,001 -13.3% 7
South Sudan South Sudan 14,450,000 -7.73% 17
Syria Syria 53,750,000 -28.6% 4
Togo Togo 880,000 +115% 48
Thailand Thailand 0 -100% 70
Tajikistan Tajikistan 280,000 59
Tunisia Tunisia 2,160,000 -26.8% 39
Turkey Turkey 6,870,000 +159% 24
Tanzania Tanzania 33,689,999 -33.6% 8
Uganda Uganda 54,070,000 -16.2% 3
Ukraine Ukraine 150,690,002 +330% 1
Vietnam Vietnam -2,340,000 -244% 72
Kosovo Kosovo 240,000 -115% 61
Yemen Yemen 26,240,000 +0.306% 12
South Africa South Africa 3,090,000 +129% 32
Zambia Zambia 2,580,000 -241% 34
Zimbabwe Zimbabwe 4,720,000 +9.26% 27

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'DC.DAC.DNKL.CD'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'DC.DAC.DNKL.CD'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))