Fixed telephone subscriptions

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 181,963 +12.2% 104
Angola Angola 86,613 -7.85% 116
Albania Albania 173,135 -2.32% 105
Andorra Andorra 51,690 +1.61% 127
United Arab Emirates United Arab Emirates 2,258,510 -1.21% 46
Argentina Argentina 7,034,210 -0.0946% 21
Armenia Armenia 331,021 -9.47% 88
Australia Australia 6,458,000 +0.76% 23
Austria Austria 3,604,100 -2.01% 33
Azerbaijan Azerbaijan 1,635,250 -0.36% 53
Burundi Burundi 14,363 -3.72% 136
Belgium Belgium 2,667,340 -10.1% 40
Benin Benin 1,427 -6.49% 148
Bangladesh Bangladesh 296,327 +2.77% 92
Bulgaria Bulgaria 619,365 -10.4% 74
Bahrain Bahrain 261,665 -0.852% 95
Bahamas Bahamas 96,729 +11.8% 113
Bosnia & Herzegovina Bosnia & Herzegovina 613,464 -5.75% 75
Belarus Belarus 4,172,630 -1.35% 31
Brazil Brazil 25,574,000 -6.2% 10
Brunei Brunei 121,819 -0.315% 111
Bhutan Bhutan 18,410 -5.91% 135
Botswana Botswana 89,785 -2.12% 114
Canada Canada 11,296,000 -1.11% 16
Switzerland Switzerland 2,860,970 -4.77% 36
Chile Chile 1,977,660 -10.8% 47
China China 179,414,000 0% 1
Côte d’Ivoire Côte d’Ivoire 244,387 -7.19% 97
Congo - Kinshasa Congo - Kinshasa 0 150
Colombia Colombia 7,276,990 -3.61% 20
Comoros Comoros 8,823 +19.7% 140
Cape Verde Cape Verde 60,376 +5.89% 124
Costa Rica Costa Rica 629,688 +28.8% 73
Cuba Cuba 1,588,920 +0.978% 54
Curaçao Curaçao 45,974 -9.1% 128
Cyprus Cyprus 269,918 -9.24% 94
Czechia Czechia 1,201,250 -3.18% 62
Germany Germany 38,700,000 +0.311% 4
Djibouti Djibouti 28,673 +2.66% 133
Denmark Denmark 735,422 -1.62% 70
Dominican Republic Dominican Republic 1,144,210 +0.028% 64
Algeria Algeria 6,324,380 +13.4% 24
Ecuador Ecuador 1,434,440 -12.8% 56
Egypt Egypt 12,474,700 +7.34% 15
Spain Spain 18,395,300 -1.56% 14
Estonia Estonia 238,455 -10.3% 98
Finland Finland 158,000 -12.7% 107
France France 37,281,000 -1.55% 5
Gabon Gabon 54,557 +25.7% 126
United Kingdom United Kingdom 26,652,000 -11.3% 9
Georgia Georgia 277,967 -12% 93
Ghana Ghana 318,460 -3.5% 89
Greece Greece 5,091,490 +4.39% 27
Guatemala Guatemala 1,940,400 +1.19% 49
Hong Kong SAR China Hong Kong SAR China 3,486,660 -5.08% 34
Honduras Honduras 443,823 +7.22% 84
Croatia Croatia 1,203,270 -2.52% 61
Hungary Hungary 2,693,220 -5.35% 38
Indonesia Indonesia 9,160,120 +8.74% 18
India India 30,933,200 +12.7% 6
Ireland Ireland 1,176,860 -3.73% 63
Iran Iran 29,019,900 -1.1% 7
Iceland Iceland 82,491 -11.3% 117
Israel Israel 2,559,860 -28.4% 42
Italy Italy 20,106,800 +1.21% 13
Jamaica Jamaica 458,723 +2.66% 82
Jordan Jordan 450,761 +0.488% 83
Japan Japan 59,326,700 -1.94% 3
Kazakhstan Kazakhstan 2,686,900 -5.21% 39
Kenya Kenya 67,840 +7.5% 121
Kyrgyzstan Kyrgyzstan 185,463 -14% 103
Cambodia Cambodia 32,723 -14.5% 131
Kiribati Kiribati 17 149
South Korea South Korea 22,155,000 -2.87% 11
Kuwait Kuwait 572,621 +0.0192% 77
Laos Laos 1,233,790 -6.92% 59
Liechtenstein Liechtenstein 10,280 -4.9% 138
Sri Lanka Sri Lanka 1,706,640 -33.9% 52
Lesotho Lesotho 7,342 +8.87% 142
Lithuania Lithuania 223,500 -10.6% 100
Latvia Latvia 141,935 -18.6% 108
Macao SAR China Macao SAR China 87,038 -5.78% 115
Morocco Morocco 2,874,000 +8.65% 35
Monaco Monaco 43,251 +1.41% 129
Moldova Moldova 847,577 -10.9% 67
Madagascar Madagascar 3,413 -91.3% 144
Maldives Maldives 12,860 -3.86% 137
Mexico Mexico 28,784,600 +8.55% 8
Malta Malta 259,180 +0.0232% 96
Myanmar (Burma) Myanmar (Burma) 587,710 +9.76% 76
Montenegro Montenegro 190,344 -0.132% 102
Mongolia Mongolia 481,699 +12.2% 80
Mauritania Mauritania 30,213 -36.4% 132
Mauritius Mauritius 463,800 +0.368% 81
Malawi Malawi 4,808 -49.2% 143
Malaysia Malaysia 8,401,800 -0.735% 19
Namibia Namibia 81,114 -5.48% 119
Niger Niger 171,514 +50% 106
Nigeria Nigeria 111,971 +15.4% 112
Nicaragua Nicaragua 234,323 +8.62% 99
Netherlands Netherlands 4,262,000 -6.74% 30
New Zealand New Zealand 665,000 -12.3% 71
Oman Oman 438,609 -2.11% 85
Pakistan Pakistan 2,573,430 -0.268% 41
Panama Panama 774,060 -8.18% 68
Peru Peru 1,504,400 -16.3% 55
Philippines Philippines 4,627,110 -3.59% 29
Poland Poland 4,899,510 -6.45% 28
Puerto Rico Puerto Rico 758,051 +2.56% 69
Portugal Portugal 5,501,590 +1.18% 26
Paraguay Paraguay 205,511 +22% 101
Palestinian Territories Palestinian Territories 383,653 -16.2% 87
French Polynesia French Polynesia 65,969 -52.4% 123
Qatar Qatar 525,562 +0.343% 78
Romania Romania 1,960,000 -11.8% 48
Russia Russia 20,816,300 -5.33% 12
Rwanda Rwanda 8,361 -19% 141
Saudi Arabia Saudi Arabia 6,788,090 +0.219% 22
Senegal Senegal 399,041 +34.3% 86
Singapore Singapore 1,900,500 -2.91% 50
El Salvador El Salvador 879,478 +1.94% 65
Somalia Somalia 55,005 -39.6% 125
Serbia Serbia 2,484,670 -2.15% 43
South Sudan South Sudan 0 150
São Tomé & Príncipe São Tomé & Príncipe 1,957 -21.8% 146
Suriname Suriname 128,908 +19.1% 110
Slovakia Slovakia 505,449 -6.49% 79
Slovenia Slovenia 646,917 -4% 72
Sweden Sweden 871,848 -20.6% 66
Eswatini Eswatini 41,939 +8.15% 130
Seychelles Seychelles 18,444 -3.06% 134
Syria Syria 2,816,070 +0.717% 37
Chad Chad 0 -100% 150
Togo Togo 66,516 +1.38% 122
Thailand Thailand 4,087,000 -6.43% 32
Timor-Leste Timor-Leste 1,785 -2.99% 147
Trinidad & Tobago Trinidad & Tobago 310,693 -4.84% 90
Tunisia Tunisia 1,863,140 +4.11% 51
Turkey Turkey 9,925,530 -11.4% 17
Tanzania Tanzania 75,732 -10.6% 120
Uganda Uganda 131,143 +12.1% 109
Ukraine Ukraine 1,434,270 -17.5% 57
Uruguay Uruguay 1,204,880 -4.27% 60
United States United States 84,830,000 -6.73% 2
Uzbekistan Uzbekistan 6,147,120 +8.11% 25
St. Vincent & Grenadines St. Vincent & Grenadines 10,250 -6.95% 139
Venezuela Venezuela 2,389,960 -10.9% 44
Vietnam Vietnam 2,316,280 -3.11% 45
Vanuatu Vanuatu 3,163 -7.97% 145
South Africa South Africa 1,353,130 +3.32% 58
Zambia Zambia 81,264 -15.6% 118
Zimbabwe Zimbabwe 309,645 +6.29% 91

                    
# 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 = 'IT.MLT.MAIN'

# 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 <- 'IT.MLT.MAIN'

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