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

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 4,420,000 +4.25% 14
Argentina Argentina 30,000 -57.1% 41
Bangladesh Bangladesh 740,000 +957% 26
Brazil Brazil 30,000 -75% 41
Botswana Botswana 100,000 -50% 35
China China 70,000 -70.8% 38
Cameroon Cameroon 20,000 0% 42
Colombia Colombia 560,000 +16.7% 29
Costa Rica Costa Rica 20,000 -66.7% 42
Dominica Dominica 20,000 -50% 42
Algeria Algeria 10,000 -66.7% 43
Ecuador Ecuador 10,000 0% 43
Ethiopia Ethiopia 1,870,000 -47.5% 19
Fiji Fiji 11,010,000 -86.3% 6
Micronesia (Federated States of) Micronesia (Federated States of) 110,000 -89% 34
Ghana Ghana 80,000 -73.3% 37
Grenada Grenada 0 -100% 44
Guatemala Guatemala 30,000 -57.1% 41
Guyana Guyana 10,000 -80% 43
Indonesia Indonesia 5,470,000 -48% 10
India India 40,000 -95.7% 40
Iraq Iraq 980,000 -62.7% 21
Jamaica Jamaica 40,000 -73.3% 40
Jordan Jordan 90,000 +80% 36
Kenya Kenya 770,000 +8.45% 25
Cambodia Cambodia 3,240,000 -62.7% 16
Kiribati Kiribati 11,660,000 -50.9% 5
Laos Laos 5,290,000 +10.7% 11
Sri Lanka Sri Lanka 1,310,000 +102% 20
Mexico Mexico 10,000 -90.9% 43
Marshall Islands Marshall Islands 900,000 -26.8% 23
Myanmar (Burma) Myanmar (Burma) 12,320,000 -31.4% 4
Mongolia Mongolia 10,000 -87.5% 43
Malawi Malawi 60,000 -75% 39
Malaysia Malaysia 40,000 -63.6% 40
Namibia Namibia 30,000 -66.7% 41
Nigeria Nigeria 60,000 -76% 39
Nepal Nepal 270,000 -77.3% 32
Nauru Nauru 2,050,000 -34.7% 18
Pakistan Pakistan 950,000 -19.5% 22
Panama Panama 0 -100% 44
Peru Peru 30,000 -57.1% 41
Philippines Philippines 3,310,000 +51.1% 15
Palau Palau 740,000 -22.1% 26
Papua New Guinea Papua New Guinea 17,850,000 -24.8% 2
Paraguay Paraguay 20,000 +100% 42
Palestinian Territories Palestinian Territories 450,000 -36.6% 30
Rwanda Rwanda 890,000 -14.4% 24
Solomon Islands Solomon Islands 22,959,999 -22.4% 1
Somalia Somalia 700,000 -34.6% 27
South Sudan South Sudan 700,000 -75.3% 27
Eswatini Eswatini 180,000 +125% 33
Syria Syria 950,000 -32.6% 22
Thailand Thailand 20,000 -91.7% 42
Timor-Leste Timor-Leste 7,640,000 -42.5% 9
Tonga Tonga 8,120,000 -46.9% 8
Tuvalu Tuvalu 4,460,000 -19.1% 13
Tanzania Tanzania 10,000 -90.9% 43
Uganda Uganda 310,000 +244% 31
Ukraine Ukraine 4,910,000 12
Vietnam Vietnam 2,240,000 +7.18% 17
Vanuatu Vanuatu 10,160,000 -60.7% 7
Samoa Samoa 15,800,000 -38.3% 3
Yemen Yemen 950,000 -61.7% 22
South Africa South Africa 20,000 -83.3% 42
Zambia Zambia 640,000 -30.4% 28

                    
# 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.NZLL.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.NZLL.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))