Getting started with data and plotting

In this tutorial we will learn how to read tabular data into Julia, and some of the basics of plotting.

If you're new to Julia, start by reading Getting started with Julia and Getting started with JuMP first.

Note

There are multiple ways to read the same kind of data into Julia. This tutorial focuses on DataFrames.jl because it provides the ecosystem to work with most of the required file types in a straightforward manner.

Before we get started, we need this constant to point to where the data files are.

const DATA_DIR = joinpath(@__DIR__, "data")
"/home/runner/work/JuMP.jl/JuMP.jl/docs/build/tutorials/getting_started/data"

Where to get help

Read the documentation

Preliminaries

To get started, we need to install some packages.

DataFrames.jl

The DataFrames package provides a set of tools for working with tabular data. It is available through the Julia package manager.

using Pkg
Pkg.add("DataFrames")
import DataFrames

!!! info What is a DataFrame? A DataFrame is a data structure like a table or spreadsheet. You can use it for storing and exploring a set of related data values. Think of it as a smarter array for holding tabular data.

Plots.jl

The Plots package provides a set of tools for plotting. It is available through the Julia package manager.

using Pkg
Pkg.add("Plots")
import Plots

CSV .jl

CSV and other delimited text files can be read by the CSV.jl package.

Pkg.add("CSV")
import CSV

DataFrame basics

To read a CSV file into a DataFrame, we use the CSV.read function.

csv_df = CSV.read(joinpath(DATA_DIR, "StarWars.csv"), DataFrames.DataFrame)

20 rows × 13 columns

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64StringStringStringStringStringStringStringStringStringString
1Anakin Skywalkermale1.8884blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber
2Padme Amidalafemale1.6545brownbrownlightNaboo46BBY19BBYno_jedihumanunarmed
3Luke Skywalkermale1.7277blueblondfairTatooine19BBYunk_diedjedihumanlightsaber
4Leia Skywalkerfemale1.549brownbrownlightAlderaan19BBYunk_diedno_jedihumanblaster
5Qui-Gon Jinnmale1.9388.5bluebrownlightunk_planet92BBY32BBYjedihumanlightsaber
6Obi-Wan Kenobimale1.8277bluegrayauburnfairStewjon57BBY0BBYjedihumanlightsaber
7Han Solomale1.880brownbrownlightCorellia29BBYunk_diedno_jedihumanblaster
8Sheev Palpatinemale1.7375blueredpaleNaboo82BBY10ABYno_jedihumanforce-lightning
9R2-D2male0.9632NANANANaboo33BBYunk_diedno_jedidroidunarmed
10C-3POmale1.6775NANANATatooine112BBY3ABYno_jedidroidunarmed
11Yodamale0.6617brownbrowngreenunk_planet896BBY4ABYjediyodalightsaber
12Darth Maulmale1.7580yellownoneredDathomir54BBYunk_diedno_jedidathomirianlightsaber
13Dookumale1.9386brownbrownlightSerenno102BBY19BBYjedihumanlightsaber
14Chewbaccamale2.28112bluebrownNAKashyyyk200BBY25ABYno_jediwookieebowcaster
15Jabbamale3.9NAyellownonetan-greenTatooineunk_born4ABYno_jedihuttunarmed
16Lando Calrissianmale1.7879brownblankdarkSocorro31BBYunk_diedno_jedihumanblaster
17Boba Fettmale1.8378brownblackbrownKamino31.5BBYunk_diedno_jedihumanblaster
18Jango Fettmale1.8379brownblackbrownConcordDawn66BBY22BBYno_jedihumanblaster
19Grievousmale2.16159goldblackorangeKaleeunk_born19BBYno_jedikaleeshslugthrower
20Chief Chirpamale1.050blackgraybrownEndorunk_born4ABYno_jediewokspear

Let's try plotting some of this data

Plots.scatter(
    csv_df.Weight,
    csv_df.Height,
    xlabel = "Weight",
    ylabel = "Height",
)

That doesn't look right. What happened? If you look at the dataframe above, it read Weight in as a String column because there are "NA" fields. Let's correct that, by telling CSV to consider "NA" as missing.

csv_df = CSV.read(
    joinpath(DATA_DIR, "StarWars.csv"),
    DataFrames.DataFrame,
    missingstring = "NA",
)

20 rows × 13 columns

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Anakin Skywalkermale1.8884.0blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber
2Padme Amidalafemale1.6545.0brownbrownlightNaboo46BBY19BBYno_jedihumanunarmed
3Luke Skywalkermale1.7277.0blueblondfairTatooine19BBYunk_diedjedihumanlightsaber
4Leia Skywalkerfemale1.549.0brownbrownlightAlderaan19BBYunk_diedno_jedihumanblaster
5Qui-Gon Jinnmale1.9388.5bluebrownlightunk_planet92BBY32BBYjedihumanlightsaber
6Obi-Wan Kenobimale1.8277.0bluegrayauburnfairStewjon57BBY0BBYjedihumanlightsaber
7Han Solomale1.880.0brownbrownlightCorellia29BBYunk_diedno_jedihumanblaster
8Sheev Palpatinemale1.7375.0blueredpaleNaboo82BBY10ABYno_jedihumanforce-lightning
9R2-D2male0.9632.0missingmissingmissingNaboo33BBYunk_diedno_jedidroidunarmed
10C-3POmale1.6775.0missingmissingmissingTatooine112BBY3ABYno_jedidroidunarmed
11Yodamale0.6617.0brownbrowngreenunk_planet896BBY4ABYjediyodalightsaber
12Darth Maulmale1.7580.0yellownoneredDathomir54BBYunk_diedno_jedidathomirianlightsaber
13Dookumale1.9386.0brownbrownlightSerenno102BBY19BBYjedihumanlightsaber
14Chewbaccamale2.28112.0bluebrownmissingKashyyyk200BBY25ABYno_jediwookieebowcaster
15Jabbamale3.9missingyellownonetan-greenTatooineunk_born4ABYno_jedihuttunarmed
16Lando Calrissianmale1.7879.0brownblankdarkSocorro31BBYunk_diedno_jedihumanblaster
17Boba Fettmale1.8378.0brownblackbrownKamino31.5BBYunk_diedno_jedihumanblaster
18Jango Fettmale1.8379.0brownblackbrownConcordDawn66BBY22BBYno_jedihumanblaster
19Grievousmale2.16159.0goldblackorangeKaleeunk_born19BBYno_jedikaleeshslugthrower
20Chief Chirpamale1.050.0blackgraybrownEndorunk_born4ABYno_jediewokspear

Then let's re-plot our data

Plots.scatter(
    csv_df.Weight,
    csv_df.Height,
    title = "Height vs Weight of StarWars characters",
    xlabel = "Weight",
    ylabel = "Height",
    label = false,
    ylims = (0, 3),
)

Better!

Tip

Read the CSV documentation for other parsing options.

DataFrames.jl supports manipulation using functions similar to pandas. For example, split the dataframe into groups based on eye-color:

by_eyecolor = DataFrames.groupby(csv_df, :Eyecolor)

GroupedDataFrame with 7 groups based on key: Eyecolor

First Group (5 rows): Eyecolor = "blue"

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Anakin Skywalkermale1.8884.0blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber
2Luke Skywalkermale1.7277.0blueblondfairTatooine19BBYunk_diedjedihumanlightsaber
3Qui-Gon Jinnmale1.9388.5bluebrownlightunk_planet92BBY32BBYjedihumanlightsaber
4Sheev Palpatinemale1.7375.0blueredpaleNaboo82BBY10ABYno_jedihumanforce-lightning
5Chewbaccamale2.28112.0bluebrownmissingKashyyyk200BBY25ABYno_jediwookieebowcaster

Last Group (1 row): Eyecolor = "black"

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Chief Chirpamale1.050.0blackgraybrownEndorunk_born4ABYno_jediewokspear

Then recombine into a single dataframe based on a function operating over the split dataframes:

eyecolor_count = DataFrames.combine(by_eyecolor) do df
    return DataFrames.nrow(df)
end

7 rows × 2 columns

Eyecolorx1
String?Int64
1blue5
2brown8
3bluegray1
4missing2
5yellow2
6gold1
7black1

We can rename columns:

DataFrames.rename!(eyecolor_count, :x1 => :count)

7 rows × 2 columns

Eyecolorcount
String?Int64
1blue5
2brown8
3bluegray1
4missing2
5yellow2
6gold1
7black1

Drop some missing rows:

DataFrames.dropmissing!(eyecolor_count, :Eyecolor)

6 rows × 2 columns

Eyecolorcount
StringInt64
1blue5
2brown8
3bluegray1
4yellow2
5gold1
6black1

Then we can visualize the data:

sort!(eyecolor_count, :count, rev = true)
Plots.bar(
    eyecolor_count.Eyecolor,
    eyecolor_count.count,
    xlabel = "Eyecolor",
    ylabel = "Number of characters",
    label = false,
)

Other Delimited Files

We can also use the CSV.jl package to read any other delimited text file format.

By default, CSV.File will try to detect a file's delimiter from the first 10 lines of the file.

Candidate delimiters include ',', '\t', ' ', '|', ';', and ':'. If it can't auto-detect the delimiter, it will assume ','.

Let's take the example of space separated data.

ss_df = CSV.read(joinpath(DATA_DIR, "Cereal.txt"), DataFrames.DataFrame)

23 rows × 10 columns

NameCupsCaloriesCarbsFatFiberPotassiumProteinSodiumSugars
StringFloat64Int64Float64Int64Float64Int64Int64Int64Int64
1CapnCrunch0.7512012.020.035122012
2CocoaPuffs1.011012.010.055118013
3Trix1.011013.010.025114012
4AppleJacks1.011011.001.030212514
5CornChex1.011022.000.02522803
6CornFlakes1.010021.001.03522902
7Nut&Honey0.6712015.010.04021909
8Smacks0.751109.011.04027015
9MultiGrain1.010015.012.09022206
10CracklinOat0.511010.034.016031407
11GrapeNuts0.2511017.003.09031793
12HoneyNutCheerios0.7511011.511.590325010
13NutriGrain0.6714021.023.013032207
14Product191.010020.001.04533203
15TotalRaisinBran1.014015.014.0230319014
16WheatChex0.6710017.013.011532303
17Oatmeal0.513013.521.5120317010
18Life0.6710012.022.09541506
19Maypo1.010016.010.095403
20QuakerOats0.510014.012.011041356
21Muesli1.015016.033.0170415011
22Cheerios1.2511017.022.010562901
23SpecialK1.011016.001.05562303

We can also specify the delimiter by passing the delim argument.

delim_df = CSV.read(
    joinpath(DATA_DIR, "Soccer.txt"),
    DataFrames.DataFrame,
    delim = "::",
)

20 rows × 7 columns

TeamPlayedWinsDrawsLossesGoals_forGoals_against
StringInt64Int64Int64Int64StringString
1Barcelona383044110 goals21 goals
2Real Madrid383026118 goals38 goals
3Atletico Madrid38239667 goals29 goals
4Valencia382211570 goals32 goals
5Seville38237871 goals45 goals
6Villarreal3816121048 goals37 goals
7Athletic Bilbao3815101342 goals41 goals
8Celta Vigo3813121347 goals44 goals
9Malaga381481642 goals48 goals
10Espanyol3813101547 goals51 goals
11Rayo Vallecano381541946 goals68 goals
12Real Sociedad3811131444 goals51 goals
13Elche381181935 goals62 goals
14Levante389101934 goals67 goals
15Getafe381072133 goals64 goals
16Deportivo La Coruna387141735 goals60 goals
17Granada387141729 goals64 goals
18Eibar38982134 goals55 goals
19Almeria38882235 goals64 goals
20Cordoba383112422 goals68 goals

Working with DataFrames

Now that we have read the required data into a DataFrame, let us look at some basic operations we can perform on it.

Querying Basic Information

The size function gets us the dimensions of the DataFrame:

DataFrames.size(ss_df)
(23, 10)

We can also use the nrow and ncol functions to get the number of rows and columns respectively:

DataFrames.nrow(ss_df), DataFrames.ncol(ss_df)
(23, 10)

The describe function gives basic summary statistics of data in a DataFrame:

DataFrames.describe(ss_df)

10 rows × 7 columns

variablemeanminmedianmaxnmissingeltype
SymbolUnion…AnyUnion…AnyInt64DataType
1NameAppleJacksWheatChex0String
2Cups0.8230430.251.01.250Float64
3Calories113.043100110.01500Int64
4Carbs15.04359.015.022.00Float64
5Fat1.1304301.030Int64
6Fiber1.565220.01.54.00Float64
7Potassium86.30432590.02300Int64
8Protein2.9130413.060Int64
9Sodium189.9570190.03200Int64
10Sugars7.5217417.0150Int64

Names of every column can be obtained by the names function:

DataFrames.names(ss_df)
10-element Vector{String}:
 "Name"
 "Cups"
 "Calories"
 "Carbs"
 "Fat"
 "Fiber"
 "Potassium"
 "Protein"
 "Sodium"
 "Sugars"

Corresponding data types are obtained using the broadcasted eltype function:

eltype.(ss_df)

23 rows × 10 columns

NameCupsCaloriesCarbsFatFiberPotassiumProteinSodiumSugars
DataTypeDataTypeDataTypeDataTypeDataTypeDataTypeDataTypeDataTypeDataTypeDataType
1CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
2CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
3CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
4CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
5CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
6CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
7CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
8CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
9CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
10CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
11CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
12CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
13CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
14CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
15CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
16CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
17CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
18CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
19CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
20CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
21CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
22CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64
23CharFloat64Int64Float64Int64Float64Int64Int64Int64Int64

Accessing the Data

Similar to regular arrays, we use numerical indexing to access elements of a DataFrame:

csv_df[1, 1]
"Anakin Skywalker"

The following are different ways to access a column:

csv_df[!, 1]
20-element Vector{String}:
 "Anakin Skywalker"
 "Padme Amidala"
 "Luke Skywalker"
 "Leia Skywalker"
 "Qui-Gon Jinn"
 "Obi-Wan Kenobi"
 "Han Solo"
 "Sheev Palpatine"
 "R2-D2"
 "C-3PO"
 "Yoda"
 "Darth Maul"
 "Dooku"
 "Chewbacca"
 "Jabba"
 "Lando Calrissian"
 "Boba Fett"
 "Jango Fett"
 "Grievous"
 "Chief Chirpa"
csv_df[!, :Name]
20-element Vector{String}:
 "Anakin Skywalker"
 "Padme Amidala"
 "Luke Skywalker"
 "Leia Skywalker"
 "Qui-Gon Jinn"
 "Obi-Wan Kenobi"
 "Han Solo"
 "Sheev Palpatine"
 "R2-D2"
 "C-3PO"
 "Yoda"
 "Darth Maul"
 "Dooku"
 "Chewbacca"
 "Jabba"
 "Lando Calrissian"
 "Boba Fett"
 "Jango Fett"
 "Grievous"
 "Chief Chirpa"
csv_df.Name
20-element Vector{String}:
 "Anakin Skywalker"
 "Padme Amidala"
 "Luke Skywalker"
 "Leia Skywalker"
 "Qui-Gon Jinn"
 "Obi-Wan Kenobi"
 "Han Solo"
 "Sheev Palpatine"
 "R2-D2"
 "C-3PO"
 "Yoda"
 "Darth Maul"
 "Dooku"
 "Chewbacca"
 "Jabba"
 "Lando Calrissian"
 "Boba Fett"
 "Jango Fett"
 "Grievous"
 "Chief Chirpa"
csv_df[:, 1] # Note that this creates a copy.
20-element Vector{String}:
 "Anakin Skywalker"
 "Padme Amidala"
 "Luke Skywalker"
 "Leia Skywalker"
 "Qui-Gon Jinn"
 "Obi-Wan Kenobi"
 "Han Solo"
 "Sheev Palpatine"
 "R2-D2"
 "C-3PO"
 "Yoda"
 "Darth Maul"
 "Dooku"
 "Chewbacca"
 "Jabba"
 "Lando Calrissian"
 "Boba Fett"
 "Jango Fett"
 "Grievous"
 "Chief Chirpa"

The following are different ways to access a row:

csv_df[1:1, :]

1 rows × 13 columns

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Anakin Skywalkermale1.8884.0blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber
csv_df[1, :] # This produces a DataFrameRow.

DataFrameRow (13 columns)

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Anakin Skywalkermale1.8884.0blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber

We can change the values just as we normally assign values.

Assign a range to scalar:

csv_df[1:3, :Height] .= 1.83
3-element view(::Vector{Float64}, 1:3) with eltype Float64:
 1.83
 1.83
 1.83

Assign a vector:

csv_df[4:6, :Height] = [1.8, 1.6, 1.8]
3-element Vector{Float64}:
 1.8
 1.6
 1.8
csv_df

20 rows × 13 columns

NameGenderHeightWeightEyecolorHaircolorSkincolorHomelandBornDiedJediSpeciesWeapon
StringStringFloat64Float64?String?String?String?StringStringStringStringStringString
1Anakin Skywalkermale1.8384.0blueblondfairTatooine41.9BBY4ABYjedihumanlightsaber
2Padme Amidalafemale1.8345.0brownbrownlightNaboo46BBY19BBYno_jedihumanunarmed
3Luke Skywalkermale1.8377.0blueblondfairTatooine19BBYunk_diedjedihumanlightsaber
4Leia Skywalkerfemale1.849.0brownbrownlightAlderaan19BBYunk_diedno_jedihumanblaster
5Qui-Gon Jinnmale1.688.5bluebrownlightunk_planet92BBY32BBYjedihumanlightsaber
6Obi-Wan Kenobimale1.877.0bluegrayauburnfairStewjon57BBY0BBYjedihumanlightsaber
7Han Solomale1.880.0brownbrownlightCorellia29BBYunk_diedno_jedihumanblaster
8Sheev Palpatinemale1.7375.0blueredpaleNaboo82BBY10ABYno_jedihumanforce-lightning
9R2-D2male0.9632.0missingmissingmissingNaboo33BBYunk_diedno_jedidroidunarmed
10C-3POmale1.6775.0missingmissingmissingTatooine112BBY3ABYno_jedidroidunarmed
11Yodamale0.6617.0brownbrowngreenunk_planet896BBY4ABYjediyodalightsaber
12Darth Maulmale1.7580.0yellownoneredDathomir54BBYunk_diedno_jedidathomirianlightsaber
13Dookumale1.9386.0brownbrownlightSerenno102BBY19BBYjedihumanlightsaber
14Chewbaccamale2.28112.0bluebrownmissingKashyyyk200BBY25ABYno_jediwookieebowcaster
15Jabbamale3.9missingyellownonetan-greenTatooineunk_born4ABYno_jedihuttunarmed
16Lando Calrissianmale1.7879.0brownblankdarkSocorro31BBYunk_diedno_jedihumanblaster
17Boba Fettmale1.8378.0brownblackbrownKamino31.5BBYunk_diedno_jedihumanblaster
18Jango Fettmale1.8379.0brownblackbrownConcordDawn66BBY22BBYno_jedihumanblaster
19Grievousmale2.16159.0goldblackorangeKaleeunk_born19BBYno_jedikaleeshslugthrower
20Chief Chirpamale1.050.0blackgraybrownEndorunk_born4ABYno_jediewokspear
Tip

There are a lot more things which can be done with a DataFrame. Read the docs for more information.

For information on dplyr-type syntax:

Example: the passport problem

Let's now apply what we have learned to solve a real problem.

Data manipulation

The Passport Index Dataset lists travel visa requirements for 199 countries, in .csv format. Our task is to find the minimum number of passports required to visit all countries.

passport_data = CSV.read(
    joinpath(DATA_DIR, "passport-index-matrix.csv"),
    DataFrames.DataFrame,
)

199 rows × 200 columns

PassportAfghanistanAlbaniaAlgeriaAndorraAngolaAntigua and BarbudaArgentinaArmeniaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBhutanBoliviaBosnia and HerzegovinaBotswanaBrazilBruneiBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCentral African RepublicChadChileChinaColombiaComorosCongoDR CongoCosta RicaIvory CoastCroatiaCubaCyprusCzech RepublicDenmarkDjiboutiDominicaDominican RepublicEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaSwazilandEthiopiaFijiFinlandFranceGabonGambiaGeorgiaGermanyGhanaGreeceGrenadaGuatemalaGuineaGuinea-BissauGuyanaHaitiHondurasHong KongHungaryIcelandIndiaIndonesiaIranIraqIrelandIsraelItalyJamaicaJapanJordanKazakhstanKenyaKiribatiKosovoKuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacaoMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMauritaniaMauritiusMexicoMicronesiaMoldovaMonacoMongoliaMontenegroMoroccoMozambiqueMyanmarNamibiaNauruNepalNetherlandsNew ZealandNicaraguaNigerNigeriaNorth KoreaNorth MacedoniaNorwayOmanPakistanPalauPalestinePanamaPapua New GuineaParaguayPeruPhilippinesPolandPortugalQatarRomaniaRussian FederationRwandaSaint Kitts and NevisSaint LuciaSamoaSan MarinoSao Tome and PrincipeSaudi ArabiaSenegalSerbiaSeychellesSierra LeoneSingaporeSlovakiaSloveniaSolomon IslandsSomaliaSouth AfricaSouth KoreaSouth SudanSpainSri LankaSaint Vincent and the GrenadinesSudanSurinameSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTimor-LesteTogoTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTuvaluUgandaUkraineUnited Arab EmiratesUnited KingdomUnited StatesUruguayUzbekistanVanuatuVaticanVenezuelaViet NamYemenZambiaZimbabwe
StringInt64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64
1Afghanistan-1000000000000100000010000000100100000100020000013000000001000100000000103000000000000000000000001000001100100010030000010000000000000010000000010010010000010000010000030000000001100000110000000000000
2Albania0-103030303100133300013030300100100303100023133313331300301033133303000103033323100331000103011301003333113103011033303011001300000331013000003313010013000310333010303230133000101103030113000010300011
3Algeria00-10100000100000003010000000100100000100020100013030000001000100010003103030003100000010100000011000001103130031030000311001001000000013000000010010010001010000010000230000301101100310110000010000101
4Andorra030-1033323131103330033030300102300303100323133313331300331033133303030103333323103331310103131311003333113103111333303310001333000331013313333333010313301310333113303230133031131100330113332333331011
5Angola0000-100000000100003010300000100300000100020100013030000001000100010000103000023100000000100001001000001100100013030000030301001000000110300030010010010300010300013000230100000101100300130000010000033
6Antigua and Barbuda03030-10103030133330013330300100100303100323333313331300331333133303330133333323103033010133001313003331133103013033303010001303000330013300333333013313000310333113303230333000301103310133030013330033
7Argentina030313-1303131133330033330310100100303100323133313331300331333103303330133333323103333313103031311003331113103113333333311001333000331113313333333313313001310333113303230333001131103330113330333331011
8Armenia0300033-100030133000010030000100100000100020100013030000001000103000000103030023300001013000031011000003113100011033003010301000000000013300000010310010001010000010000230100003101100010113000330001001
9Australia03031333-13131133330033301310102100303100323133313331300331333133303330133333323103333313133131313003333113103113333303311301333000331013311333333013313001310333113303230133031131111310110332333331011
10Austria030313332-1131133330033333310102300303100323133313331300331333133303330133333323103333313133131313003333113103313333303311301333000331133313333333013333303310333313303230133031133133310313332333331011
11Azerbaijan0300030000-130133000013000000100100003100020100013030000001000103000000103000023300001013000031011000001113100111033003010301001000301113000000030310010000310000010000230100003001100030113000033001001
12Bahamas03030301031-10130330013330300102100333100323133313331300331333133303330133333323103333310333001313003331133103013333303010001303000330113300333333013313001310333113303230333000301113010130333313300033
13Bahrain030000010013-1103000013301000100100000100020100013333300001000103000030103330003100000030103331031000001113100013030000310001033000003113000030030013010031310300010300230100311131100330110300013000101
14Bangladesh0000000000030-130000310000000100100000100020000013000000001300130000300103000003000003000100000003000000101100010030000011001000000000000000000010013010000010000010000230100000001103000110000013000000
15Barbados03030331031303-13330013330300102100333100323333313330330331333133303330133333323103333310333001313003331133103113333303010001303000330113300333313013313001310333113303230333000301113310130130313330033
16Belarus030003330030013-1000010030000100100030100020300013030000001000133000000103030003100301013100031011000003113100011033033011301003000001013300300030310010000310000010000230100003101100030113000033033011
17Belgium0303133323131133-130033333310102300303100323133313331300331333133303330133333323103333313133131313003333113103313333303311301333000331033313333333013333303310333313303230133031133133310313332333331011
18Belize00000301000301300-10010330000100100303100320100013330300031300133000330133330023103303000333001013000001133100113330000010001003000000013300330010013310000010300113000230300030301103030130030313030033
19Benin000000000000010000-1010000030100331000110030100013030000001000130030003303030003100000000100001001300001113130013030000010001001330000010000030010030110003013300013000230100000101300300110000000000000
20Bhutan0000000100000300000-110000000100100003100020100013031000001000130000000103030033100000010100101011000001111100011030000011001001000000013300030010010110000010300010000230000000111100010110000000000011
21Bolivia00000031001311000300-10030000100100303100320100013331000001000130000000113030023303003010100001001000001113100011030000011001001000001013303330030313110000310300013000230100000101100030110000310030010
22Bosnia and Herzegovina030300010313010330001-1030300100100333100023333313330000331033133303000103033323100031010100031301003333113103011033303011001300000331013300003313310313000310333010303230133000101103330113000030301011
23Botswana0000330000030330033010-100000100100000100020100013330000031300133010300133030023103303000303001003000001133100013030000030301000000300110300030010013310001010300013310230100000301103000110030003000033
24Brazil03031333031310333300333-10310100100303100323133313331300331333103303330133333323103333013103031311003333113103113333333311301333000331013313333333313313301310333113303230333001131113330113330333331011
25Brunei030303012313113033001330-1300302100033100323133313331300331333133303330103333323103033310303133303003333113103113033303013001333000331113310333333313313001010333110303230133031331113330113332033303011
26Bulgaria0303133323131133330013333-100102300303100323133313331300301333133303330103333323103331313133111311003333113103313333303311001333000331033313333333013333303310333310303230133031113133330313330333331011
27Burkina Faso00000000000003000030100000-10100333000110030100013030000001000130030003303030003100000000100001001300001100130011030000010001001330000010000030010010110003013300010000230100010101300300110000000000000
28Burundi000000000000010000301000000-1100130000103020100013030000001000100010000103000023100000000300000001000001100100013030000010001001000000010000030010030110001310300010000230000000101100000130000000000011
29Cambodia0000000100000100000010003000-100100000100020100013031000001000130000000103000023100000000100103001000001113100111030000013001001000000013300030010010110000010300010000230100000131100010110000010003010
30Cameroon00000000000001000030100000001-10133000130020000013030000001000100010300103000020100000000100000003000001100130011030000011000000030000010000030010010110001010300010000030000000101100000110000013000000
31Canada030313312313113333003330331010-1100303100323133313331300331333133303330133333323003333313133131313003333113103113333333311301333000331013311333333013313303310333113303230133031131113310113333333331011
32Cape Verde0000100000030100003010000030100-100000100030100013030000001000130030003303030023100000010100001001300003113130113030000010001001330000013300030010010110303013300013000230100000101300300110000010000011
33Central African Republic00000000000001000030100000301301-13000130030100013030000001000100010000103000000100300000100001001000001100100011030000010001001000000013000030010030010003010300010000230000000101100000110000000000000
34Chad000000000000010000301000001013013-1000130030100013030000001000100010000103030003100000000100001001000001103130013030000010001001330000010000030010030010003010300010000230000000001100000110000000000000
35Chile0303133103131133330033330300102100-103100323133313331300331333103303330133333323103333313103031311003333113103113333333311001333000331013313333333313313000310333113303230133031131103330113332333333011
36China03001301001311330000130010001001000-10100020000013033030001300100000300103000023100003010100001011000001111100013030000311001000000000013000000030013310101310000010000200100000111110310110300013001000
37Colombia030303310313113033003303031010010030-1100023133313331300301333103303030130333320000333000103001301003331100103111333303011001301000331013303333333313013000310333010303230133010101103030110000310331010
38Comoros0000000000000100003010000010100100000-100020100013030000001000100010000103030023100000000100001011000001133100011030000010001001000000010300030010010110001010300010000230100000101100300130000000000011
39Congo00000000000001000030100000001301330001-13030100013030000001000100010000103000000100000000100000001000001110100013030000010001000000000010000030010010010001010300010000030000000101100000110000000000010
40DR Congo000000000000010000301000001310013000010-1020100013030000001000100010000103000000100000000100000001000001100100013030000010001000000000010000030010030010003010300010000030000000101100000110000000000013
41Costa Rica0303003103130130330033333300100100303100-123133313331300301033103303330133333323103333310103001311003331113103111333303011001303000330113303333333013313001310333013303230133000101103330110130310330011
42Ivory Coast00000000000001000030100000301003330001100-10100013030000001000130030003303000023100000000100000011300001110130031030000311001001330000010000030010010110003013300010000030000000101300300110000010000000
43Croatia030313332313113333003333330010230030310032-1133313331300331033133303330103333323103331313133131311003333113103313333313311001333000331033313333333013333303310333310303230133031103133310313330333331011
44Cuba0000130100100133000010300010100100000100020-100013001000001000130000303130000023100000000100031001000001103100111030033010301000000300013000000030313310000310300010000230100001101103000110000013001011
45Cyprus03031333231311333300133333001023003031003231-13313331300331333133303330103333323103333313333111311003333113103313333313311001333000331033313333333013333303310333313303230133031313133010333330333331033
46Czech Republic030313332313113333003333331010230030310032313-1313331300331333133303330103333323103333313133131313003333113103313333303311001333000331033313333333013333303310333313303230133031133133330313332333331011
47Denmark0303133323131133330033333310102300303100323133-113331300331333133303330133333323103333313133131313003333113103313333313311301333000331033313333333013333303310333313303230133031133133330313332333333011
48Djibouti00000000001001000030100000101001000001000201000-13030000003000100010000103030020100000000100001011000001100100011030000010001001000000010000030010010110003010300010000230100000001100000110000000000010
49Dominica000303010303013333001333030010010000310032333331-1331000331333130303300133033323103333010303001303003333133103013033303010001301000030013300333313313313000310333110303230333010301113010110030313330030
50Dominican Republic0000000100000100030010300000100100003100020100010-131300001000133000330130030023100300310100001011000001113100011030000010001001000000013003330030010010001010300110300200100030101103010110000010000011
51Ecuador00000031001311030300300300001001003331000201000133-11300001000133000000133330023100303013100001001000001113100011333003011001003000001013313330030313110000010300013300230100010101103030110000310030011
52Egypt000000000000000000301000001010010000010002010001303-1000001000100010003103030003300000030100001011000003103100113030000011001001000000013000000010013010001010000010000030100001101100000110000010000101
53El Salvador0303003103030133330013030300100100303100323133313330-100301033103303030103333323103333310103001301003331113103011033303010001303000330013303033313313113001010333010303230133000101103030110130310300011
54Equatorial Guinea00000000000001000030100000001301330001300201000130300-10001000100010000103030000100000000100001001000001110100011030000010001001000000013000030010010110301010300010000230000000001100300110000000000001
55Eritrea000000000000010000301000001010010000010002000001300000-1001000100010000103000020100000000000001001000001100100011030000011001000000000010000030010010010000010300010000230000000001100000130000000000010
56Estonia0303133323131133330033333310102300303100323133313331300-131333103303330103333323103333313133131311003333113103313333313311001333000331033313333333013333303310333310303230133031133133330313332333331011
57Swaziland00001300000301300330103000001001000001000201000130300000-11300130030300133030023103303010303100003000001133100013030000030300001000000013000030010013310001010300013300230100010301103000130000003000033
58Ethiopia000000000000010000301000000010010000010002000001300000100-1000100010000103000000100000000300001001000001100100011030000010000001000000010000030010010110001010300010000230100000011100000110000000000001
59Fiji0000033100030330030010030000100100333100320100013331300001-100130000030103030023103303010333001003000001133100113030000011011003000000013310330010313310001010300110300230100000111110310130000013001033
60Finland03031333231311333300333333101023003031003231333133313003313-13133303330133333323103333313133131313003333113103313333313311301333000331133313333333013333303310333313303230133031133133330313332333333011
61France030313332313113333003333331010230030310032313331333130033133-1113303330133333323103333313133131313003333113103313333303311301333000331033313333333013333303310333313303230133031133133330313332333333011
62Gabon0000000000000300003010000000130133000130020100013030000001000-100010000103030023100000000100001001000001113100013030000310001001000000010300030010010110301010300013000030100000101100300110000010000000
63Gambia00000000000303300330103000301003000001000301000130300000313001-10030303303000023100003000300001003300001133130033030000010001001330000010000030010013110003013300010000230100000301303300130000003000000
64Georgia030303330333113330001303030010010030310002313331303100030103310-1303000103003323300331013100131311003331113103113033303011001301000031013300003333010313000310033010003230133003011100033113000330301011
65Germany0303133323131133330033333310102300303100323133313331300331333133-103330133333323103333313133131313003333113103313333333311301333000331133313333333013333303310333313303230133031133133330313332333333011
66Ghana00000000000003300330100000301003000001000300000130300000313001300-10303303000023100003010300000011300001100130013030000011000001330000110000030010033110003013300010000030100000301303000130000013000013
67Greece030313332313113333003333331010230030310032313331333130033133313330-1330133333323103333313133131311003333113103313333313311001333000331033313333333013333303310333313303230133031133133330313332333331011
68Grenada0003033103030330330013330300100100333100323333313331000331333130303-100133033323103333010333001303003333133103013033303010001301000030013300333313313313001310333110303230333000301103010130030313330033
69Guatemala03030031031301003300130303001001003031003231333133303003010331003030-10103333323103333310103001301003331113103111033303011001303000330013303333313313113001010333010303230133030101103030110030310330011
70Guinea000000000000030000301000003010030000010003000001303100000100013003000-1303030020100000000100001001300001113130011030000011001001330000010000030010030110003013300010000030000000101300300110000000000000
71Guinea-Bissau0000000000000300003010000030100300000100030100013030000001000130030003-103000000100000000100000001300001110130011030000010001001330000010000030010010110303313300010000030100000101300300110000000000000
72Guyana00000331000311300300103300001001003031003201000133310000313001300003001-13030023103003010103001003000001113100013030000010001001000000013300330030313310000010300113300230300000301103010110000313000011
73Haiti000000010000013000301000000010010000010002010001303100000100013000000013-1030023100300010100001001000001113100011030000010001000000000013000030010030010001010300010300230000030101100010110000000000011
74Honduras0303003103130100330013030300100100303100323133313330300301033133303030103-133323103330310103001301003331113103011033303010001303000330013303333313313113001010333010303230133030101103330110330310300011
75Hong Kong03030333231310333330133333101023003031000231333133330003013331003033001330-13323103333313133101313003333133103013333333313301333300331013310333333313313000310333013303230333010331113330133330313331333
76Hungary030313332313113333003333331010230030310032313331333130033133313330333010333-1323103333313133131311003333113103313333303311001333000331033313333333013333303310333313303230133031133133330313332333331011
77Iceland0303133323131133330033333310102300303100323133313331300301333133303330103333-123103333313133131313003333113103113333303311301333000331113313333333013313301310333313303230133031133133330313332333331011
78India00001001001000000003100000001001000001000200000130303000013001000003001030200-13100003010100001001000003101100113030000011003000000000013000000030013110003310000010000230100000111103300110000013001001
79Indonesia000010010010000300001003300030010030310002010001303000000130013000000013303002-1100000310100013001000003113130111030000313301001000001113010330030033010000310300010000230100001131100010110000030003001
80Iran0000000300100000000010000000100100000100020000013030000001000103000000103000020-100000000100000011000001103100010030000010001000000001010000000010010010000010000010000200100000001100030110000000030001
81Iraq00000000000000000000100000001001000001000200000130300000010001000000001030000000-10000000000000011000001103100010030000010000000000000010000000010010010000010000010000200000000101100000110000000000000
82Ireland030313332313113333003333331010230030310032313331333130033133313330333013333332310-1333313133131313003333113103313333313311301333000331013313333333013313303310333113303230133031131113310113332333331031
83Israel0303103103130133330013330300102130303100323133313330300331333103303330103333320003-133313103011303003333130103113333333011011333000330033313333313313313001310333113303230333031131113030113030333300011
84Italy03031333231311333300333333101023003031003231333133313003313331333033301333333231033-13313133131313003333113103313333303311301333000331133313333333013333303310333313303230133031133133330313332333333011
85Jamaica000003310013033003001033000010010030310002010001333100003130013000030013303002310030-1010330001003000001133100013330000011301001000000013300330010313310001310300013300230300000301103010130000313030033
86Japan0303133323131133330033303300102100333100323133313331300331333103303330133333323103333-113133133313003333113103113333333313301333000331113313333333013313303310333113303230333031131113330113332333333011
87Jordan00000001001000000000100000001001000001000200000130330000010001030000001030300230000000-10103000031030001113100011030000011001001000000013000000010013010000010000013000200100301101100330110000010000100
88Kazakhstan030003330030113300001003000010010000310032010001333100000100010300000010303002310000101-1100031011000001103100111033033011301001000000013000030030310010000310000010300230100003011100030113100030001011
89Kenya0000030000030030003010300013100100000101020300013000000033300130030300103030023100003010-130001003000001133100013030000011301000010000010300030010033110001011300010010031100000301103000130000003000033
90Kiribati00030301030301303300133003001001000001003231333133310003013331303033001030333231030330103-13001303003333133103113033300010001301000030013310333313013313001010333110303230133010301113310110030013300033
91Kosovo030000000000010000001000000010010000010002010001303000000100013000000010300000010000101000-1001001000001100100110030003010001000000301013000000010010010000310000010000230100000101100030110000000000000
92Kuwait0300000100133103000013301000100100000100020100013333300031000103000030103330003100000030103-131031000001113100113030003311001033000003113300030030013310331310300110300233100311131100330110320013000101
93Kyrgyzstan00000303003001330000100000001001000001000201000130300000010001030000001030000031000010131000-11011000001113100111033030011301001000000013000030010310110000310000010000230100003001100030113000030003001
94Laos000000010000010000001000300030010000010002010001303100000100013000000010300002310000000010010-1001000001113100010030030013001000000000013000030010310010000010300010000230100000131100000110000010003010
95Latvia0303133323131133330033333310102300303100323133313331300331333133303330103333323103333313133131-111003333113103313333313311001333000331033313333333013333303310333310303230133031133133330313332333330011
96Lebanon00000001000000000000100000001001000001000201000130300000010001030000001030000033100000300000000-11000003103100011030000010001000000001013000000030010010000010000010000200100301001100030110000010000000
97Lesotho000013000003033003301030000010010000010002010001303000003130013001030013303002310330331033300000-1000001133100013030000010301001000000013000030010013310001010300013300230100000301103000130000003000033
98Liberia0000000000000100003010000030100330000100030100013030000001000130030003303000020100000000100000001-100001100130011030000010000000330000010000030010010010003013300010300030000000101300000110300000000000
99Libya00300000000000000030100000101001000001000201000130300000010001000100001030000011000000000000000110-10001103100030030000010001000000000013000000010010010000010000010000230000000101100300110000000000000
100Liechtenstein030303332313113330003333331010230030310032313331333130030133313330333010333332310333331013313131100-1333113103013333303310301333000331013313333333013313301310333313303230133031133133330313332333331011
101Lithuania0303133323131133330033333310102300303100323133313331300331333133303330103333323103333313133131311003-133113103313333313311001333000331133313333333013333303310333310303230133031133133330313332333331011
102Luxembourg03031333231311333300333333101023003031003231333133313003313331333033301333333231033333131331333130033-13113103313333313311301333000331133313333333013333303310333313303230133031133133330313332333331011
103Macao030303030310113330001303330010030033010002313331333300030133310030330010303332310333031013300131100333-1113133013333333313301333000331013010033313313133000310333013303230133010331110030110030303301001
104Madagascar0000130000000100003010000000100100000100020100013030300031000100010030103330023100000000100001001000001-113100011030000010001003000000010300030010010110001010300010000230100000301100000130000000000013
105Malawi00001300000303300330103000001001000001000201000130300000313001300103001030300231003030103330010030000011-13100013030000030301001000000013000030010013310001010300013000230100000301103000130000003000033
106Malaysia033303312313113333001333330030010030010032333331333130033133313330333013333332330303331333313331300333313-1103113333333311301333000331113310333333013113001010333113303231333031331113330110330333333133
107Maldives0000030100130330030310303000100100000100320100013031000031300130000300103030033103003010303001003000001113-100113030000011001001000000313310030030013310000010300113000130100000131103310110130013000033
108Mali00300000000301300030100000301303030001000301000130300000010001300300033030300231000000001000010013000031001-10030030000010001000330000010000030010010110003013000010000030000000001300300110000000000000
109Malta030313332313113333001333331010230030310032313331333130033133313330333010333332310333331313313131100333311310-1313333313311001333000331133313333333013333303310333313303230133031313133310333332333331033
110Marshall Islands0003030103030100330013000300100100003100323133313331300301333100303030103333323100030010133001301003331113103-111333300010011303000030033310333313010313001010333110303230133030101110010110033013301031
111Mauritania00300000000001300030100000301003030001100301000130300000010001300100031030300031000000001000010110000011031300-11030000010001001300000010000030010010110003013300010000230100300001000300110000000000000
112Mauritius030333000313003033301330030010010033010132313331333000033133333333330010303332310033331033300130300333313310311-1033303031301331000330013300033313333313003010333013303230133010331103310130130013300033
113Mexico0303033103131033330033330300102100303100323133313331300301333103303330103333323103333313103011311003333113103113-133303311001333000330013313333333013313000310333010303230133001111103310110330313331011
114Micronesia00030001030001033300130003001001000031003231333133310003013331303030001030333201003300001330013010033311101033113-13300010011301000030033310333313010313001010333110303230133000101110010110033013301011
115Moldova030303030333013330001300030010010030310002313331303000030133310330300010300332310033100310003131100333311310301103-1303010301301000331013300303333313013000310033010003230133003101100330113000030301011
116Monaco0303133323131103330033330300102300303100323133313331300331333133303330103333323103333313103131311003333113103113333-103311001333000331113313333333013313301310333113303230133031131110330113332333331011
117Mongolia00000001000001030000100300001001003301000203000130300000010001000000001030300231003000031000330010000031131001110300-10011001000000000013300030010310110000310300010000230100001131100030113000330001010
118Montenegro030300330300010330001303030010010030310032333331303100033103313330300010303332010033101010303131100333311110301103330-1010001301000331013300303313310313000310333010303230133010101103330113300330301030
119Morocco0030100000100000033010030000100000000110030100013030000001000330000303103030003100000010100001011000003103130111030000-111001001300000013000030010010010303010000010300230100301101100330110000013000000
120Mozambique00003000000001000030103000001001000001000201000130300000310001000103001030300231000030001000000010000011301000130300000-10301001000000110000030010010110300010300013000230100000301100000110000003000033
121Myanmar000000010000000000001000300010010000010002010001303000000100010000000010300002310000001010000300100000111110001103000001-1001001000000000000030010010010000010300010000230000000131100010110000000003010
122Namibia0000330000030100033010330000100100000100020300013330000031000130010300103030023100003000303001003000003133100013030000010-101001000000010300030010010010001010300013000230100000301103310110030003000033
123Nauru00000301000301000000103000001001000001003201000133310000313001300003001030300231033030103330000030000011331001130300000100-11001000000013310300010313310000010300110300230000030301113010110030013001013
124Nepal000000000010010000001000000010010000010002000001300100000100013000000010300003310000000010000100100000010110001103000001100-1000000000313000030010010010001010300010000230100000101100000110000010000000
125Netherlands0303133323131133330033333310102300303100323133313331300331333133303330133333323103333313133131313003333113103313333313311301-133000331033313333333013333303310333313303230133031133133310313332333331011
126New Zealand03031333331311333300333333101021003031003231333133313003313331333033301333333231033333131331313130033331131031133333033113013-13000333113311333333013313001310333110303230133031131111330110332333331011
127Nicaragua030300310303013333001303030010010030010002313331333130030103310030303010330332310303001010300130100333111310301103330301000130-1000330013303033313313113000010333010303230133030101103030110030310300011
128Niger0000000000000100003010000030100333000110030100013030000001000130030003303030020100000000100000001300001100130031030000310001001-130000010000030010010010003013300010000230000000001300300110000000000000
129Nigeria00000000000000300030100000301303030001000300000130000000013001300300033030000001000000001000000113000001001300110300000100000003-10000010000000010013010003013000010000000000000001300000110000003000000
130North Korea000000010000010300001000000010010000010002010001300000000100013000000013300000010000001000003100100000111010001003000001100100100-1000013000000010010010000010000010000230000000101100000110000000000000
131North Macedonia0303033103130103300013030300100100303100023333313331300301033130303030103333323100331310103011311003333113103011033303010001303000-131013300303333010013000310333010003230133030101100330113000010301011
132Norway03031333231311333300333333101023003031003231333133313003313331333033301333333231033333131331313130033331131033133333033113013330003-11013313333333013313301310333313303230133031133133310313332333333011
133Oman000000010013310300001330300010010000010002010001303300000100010300000010303002310000003010333103100000110310001303000031000103100000-1113001030030010010031310300010300230100311131100310110320013000100
134Pakistan0000000000100000000010000000100100000100020000013000000001000100000000103000000000000000100000001000000101100010030000011001000000000-110000000030010010000010000010000030100000001103010110000003000000
135Palau00030001030001003300130003001001000031003231333130310003013331303030001030333231003300101330013010033311131033113333000100113010000300-13310333313310113001010333110303230133030101110010110033013301001
136Palestine000000000000010000003000000010010000010002010001303000003100010000000010000002310000003000000100100000110310001003000001000000300000001-1000000010010110001010000010000230100000001100000110000000030001
137Panama0303033103130133330033030300100100303100323133313331300301033103303030130333323103333010103001311003331113103011333303011001303000330013-103333333313313000010333013303230133010101103030113030310301011
138Papua New Guinea00000301000303000300103000001021000031000201000133310000313001300003001030300231003030003030010030000011131001130300000100110010000000133-10330010013110001010300110000230100000311110010110030003001001
139Paraguay030300310313110033003333031010010030310032313331333130030133310030303010333332310333301010300130100333111310301333330301000130300033111330-1333333313113000310333013303230133030101100030113330310330011
140Peru0303033103131133330033333300100100303100323133313331000301333100303030133333323100333010100001311003331113103111333303311001301000330013313-133333313113000310333013303230133010131103030110000313331011
141Philippines00000001000000000000300330003001000031003300000130300000013001300000001030300231003000001000130010000031131001110300303130010010000000130103-10010030110001010300010000230300031131101000110000013003000
142Poland030313332313113333003333331010230030310032313331333130033133313330333010333332310333331313313131100333311310331333330331100133300033103331333-1333013333303310333313303230133031133133310313330333331011
143Portugal0303133323131133330033333310102300303100323133313331300331333113303330133333323103333313133131313003333113103313333313311301333000331033313333-133013333303310333313303230133031133133310313332333331011
144Qatar03000033001301030000133010001001000331003201000133303000310001030000301033300231000000301033010310000011031000130300033110010330000031133010300-10013010300310300010300233100311131100330113020013001100
145Romania030313332313113333001333330010230030310032313331333130030133313330333010333332310333131313311131100333311310331333331331100133300033103331333333-1013333303310333310303230133031313133330313330333331031
146Russian Federation0300133300331133000033333000100100303100320300013331300031300133000330133330023100303013100033011000003103100113233033311311003000301033303330030-113330301330000013300230000033131113330113300333033011
147Rwanda00003000000001000030100000031001300001130201000130300000010001000103001030000231000000103000010010000011001100130300000100010010000001130000300100-10010301010300010010230100000301100000130000003000011
148Saint Kitts and Nevis030303310303033033001333030010010030310032333331333130030133313030333013333332310333301033300131300333113310301303330301000130300033011330033331331-1313001310333110303230333030301113330113030313330033
149Saint Lucia0003033103030130330013300300100100303100323333313331300331333130303330133333323103333010333001303003331133103013033303010001303000030113300333313013-113001010333110303230333030301113310110030013330033
150Samoa00030301030303303300133003001021000031003231333130310003313331303033001030333231030330103330013130033331331031130333030100113010000303133103333133103-13001010333110303230133000301113010110030013300033
151San Marino030303332313113330001333030010230033310032313331333130033103313330333010333332310333331030313131300333311310301333330331000133300033101331033333301031-1301310333113303230133030131100330113332333331011
152Sao Tome and Principe0000100000030100003010000010100100000100320100013031300001000100010030103330003100000010103001001000001113100011030000010001003000000013300030010030110-100010300010000230100000101100000110000000000011
153Saudi Arabia03000000001031030000103010001001000001000201000130333000010001030000301033300031000000301033310310000011131000130300003110010330000031133000300300130100-10010000010300230000311111100310110300013000100
154Senegal000000000000010000301000003010033300011003010001300000000100013003000330300002310000000010000000130000110313003103000031000100133000001300003001003011000-1013300010000230100000001300300110000010000001
155Serbia0303003103100103300013030300100100333100323333313331000331333133303000103033323100331313103131311003333101103011033333011001301000331013300303313310013000-110333010303230333000101103330113000333301031
156Seychelles03333300031303333330133303001001000301003331333133310003313331333133001030333231030330103330013030033331331031130333030103013310303310133000333333333130013-10333013303130133000301113330130330313300033
157Sierra Leone000000000003033003301030003010030000010003000001303000003130013003030330300002010000300033000000330000111313001303000001000100033000001000000001001311000301-1300010000030000000001303000130300003000000
158Singapore0303333323131133330013333330302300333100333333333331300331333133333333103333323103333313333133313003333113103113333333313301333000331113313333333033313003310-133113303130133031331113330130332333303033
159Slovakia03031333231311333300333333101023003031003231333133313003313331033033301033333231033333131331313110033331131033133333133110013330003310333133333330133333033103-13310303230133031133133330313332333331011
160Slovenia030313332313113333003333331010230030310032313331333130033133313330333010333332310333331313313131100333311310331333331331100133300033103331333333301333330331033-1310303230133031133133330313332333331011
161Solomon Islands0003030103030130330013300300102100003100323133313331300331333130303330103303323103333010333001303003331113103113033300010011303000030013310333313013313000010333-110303230133010301113000130030013301033
162Somalia00000000000001000030100000101001000001000200000130000000010001000100001030000000000000000000010110000011031000100300000100000000000000130000000100100100000100000-10000230100000001100010110000000000000
163South Africa000033310013003003301033000010010030010032010001333030003130010301033013333002310330301030301100300000313310011303000003130100300000101330333003031331000101030001-1300230100001331103310110000303030033
164South Korea0303133323131133330013333300102100303100323133313331300331333133303330133333323103333313133133313303333113103113333303313001333000331113313333333313313303310333113-103230333031131113330113332333333011
165South Sudan00000000000001000030103000031001000001000201000130310000010001000100001030000001000000001000010010000011031000100300000100010000000000130000000100300100000103000100-10230000000101100010110000000000000
166Spain030313332313113333003333331010230030310032313331333130033133311330333013333332310333331313313131300333311310331333331331130133300033113331333333301333330331033331330-1230133031133133310313332333333011
167Sri Lanka0000000000130030000010000000100100000100020000013030000001000130000300103000023100000000100001003000000101100011030000011001000000000110000000010013010000010300010000-130000000001100000110000013000000
168Saint Vincent and the Grenadines00030331030301333300133303001001003031003233333133313003013331333033301333333231033330103330013030033311331031130333030100013030000300133003333133133130013103331133032-10333030301113010130330313330033
169Sudan000000000000010000301000000010010000010002000001303000100100010001000010300000010000000010000001100000110310001003000001000100000000001000000001001011000001000001000003-1000300101100010110000000000000
170Suriname0000033100031130030010030000100100003100320100013331000001000130000300133030023100303310100000001000001113100013030000010001001000001013000330030313310001310300010300230-100000101103010110000010000011
171Sweden03031333231311333300333333101023003031003231333133313003313331333033301333333231033333131331313130033331131033133333033113013330003311333133333330133333033103333133032301-13031133133330313332333333011
172Switzerland030313332313113333003333331010230030310032313331333130033133313330333013333332310333331313313331300333311310311333330331130133300033111331333333301331330131033331330323013-1031133133330313332333331011
173Syria0000000000000100000010000000100100000100020100013030000001000100000000103000000300000000000000011000001103100000030000010000000000000013000000010010010000010000010000003000-100001100010110000000000100
174Taiwan03030301230001303300130013101021003131003231333133310003313331303030301033033231033313101330013010033331131033110303030110113330003310133133233130133130000103331103032301330-10111100010310032303300000
175Tajikistan000003030030013300001000000010010000010002010001303000000100010300000010300002310000101300003101100000110310011103300001030100100000011300003001031001000001000001000023010000-1001100030113000030000001
176Tanzania0000030000030330033010300003100100000101020100013030000031300130010303103030023100003000300001003000003133100013030000030301001000000110000030010033310001010300013010230100000-101100000130000003000033
177Thailand03000031001010000000100330003001003001000201000133300000013001030000001030300231000003101000130010000031131001110300300130010010000010133103300303101100010103001133002301000311-11100030110000013003010
178Timor-Leste000310010300013030001300030010010000010002313331303100033103313030300010303332310003001010300130100333111310301103330301000130000003001300000331301011330001033301000323013300010-1100010110030000301000
179Togo0000000000000100003010000030100303000110030100013030000001000130030003303000003100000000100001001300001103130011030000010001001330000010000030010010110003013300010000230100000101-100000110000000000000
180Tonga00030001030303303300133003001001003301003231333133310003313331303033001030333231033330103330003030033311131031130333000100113010000303133103033130133130000103331103032301330003011-13000130030013300033
181Trinidad and Tobago030303310313013033001333030010010030310032313331333130033133313033333013333332310333301033300130300333113310301333330301000130300003031330033331301331300131033311330323033300030110-1030110030313330033
182Tunisia0030000000000130033010030010100100000100030100013030000001300300010003103030003100000310130001011030001103130033030000310001001300000113000030010010010003310000010300230100301101100-130110000013000000
183Turkey03000331001311330300333330001001003031003201000133303000313001330000301033300033300033331031310110100031031001132330333110010030003011133033300300133103013103000133002311000111311133-10113000333030011
184Turkmenistan000003010010013000001000000010010000010002010001303000000100013300000010300000310000101010000101100000110310011103000001030100100000001300003001001001000001000001000023000000100110003-1110000000000001
185Tuvalu0003030103030130330013300300100100000100323133313331300331333130303330103333323103033010333001303003331133103113030300010011303000030013310313313013313001010333110303230133030301113010-110030003300033
186Uganda00000300000301300330103000031001000001000201000130300030313001300103001030300231000030003000010030000011331000130300000110010010000000100000300100331100010113000100100301000003011000001-10000003000033
187Ukraine030303330330013330001303330010010030010032313331333130033133310330303010333332310033301310013131100333110310311323333301130130300033101330330333331301300131003301000323013300313111003011-1300333300011
188United Arab Emirates0303133313133133300013333331102103333111313133313333300331333133303331113333323103030333103331331103331113133113333333310031333100333113301033333313313331331333310333133133311131130310113-120333301111
189United Kingdom03031333231311333300333333101023003031003231333133313003313331333033301333333230033333131331313130033331131033133333033113013330003310133133333330133133033103331133032301330311311133101133-12333333011
190United States030313332313113333001330331010313030310032313331333133033133311330333013333332300333331313313131300333311310331333333331130133300033103331133333301331330331033311330323013303113111331011333-1313301011
191Uruguay0303103303031133330033330300100100303100323133313331300331333103303030133333323103333310103001301003333113103111333333011001333000331013313333333313313000310333013303230133000101103030113330-113331011
192Uzbekistan00000303003000330000100000001001000001000201000130300000010001030000001030000231000010131000310110000011031000110330000113010010000000130000300103100100000100000100002301000030111000301130000-10000001
193Vanuatu000303010303013333001330030010010000010032313331333130033133313030333010333332310333300033300130300333111310311303330301001130300003001331033331331331300001033311000323013300031111301013003001-1301033
194Vatican0303133323131133330033330300102300303100323133313331300331333133303330103333323103330010103131301003331113103113033303010001333000331013310333333013013301310333010303230133031101100330113330333-100011
195Venezuela03031331030311333300333303101001003031003231333133310003013331303033001030333233000330101030113110033311131030113333030110013030003310130033333333130130000103330133032301330011011030301100003103-11011
196Viet Nam000000000010000000001000300030010030010002010001303000000100010000000010300002310000000010013300100000011310011103000001300100000000001330003001001011000001030001000023010000113110000011000001000-1010
197Yemen0000000000000000000010000000100100000100020100013030000001000100000000103000000000000000000001011000001103100010030000010001000000000013000000010010010000010000010000233000301001100000110000000000-100
198Zambia00003300000303300330103000001001000001000201000130300000313001300103001030300231000030003300000030000011331000130300000303010010000001100000300100133100010103000130002301000003011030101300000030000-13
199Zimbabwe000030000003013003301030000010010000010302010001303000003130013003000010303002310000001033000000300000113310001303000003030000100000001300003001001311000101030001300023010000030110300013000000300003-1

In this dataset, the first column represents a passport (=from) and each remaining column represents a foreign country (=to).

The values in each cell are as follows:

  • 3 = visa-free travel
  • 2 = eTA is required
  • 1 = visa can be obtained on arrival
  • 0 = visa is required
  • -1 is for all instances where passport and destination are the same

Our task is to find out the minimum number of passports needed to visit every country without requiring a visa.

The values we are interested in are -1 and 3. Let's modify the dataframe so that the -1 and 3 are 1 (true), and all others are 0 (false):

function modifier(x)
    if x == -1 || x == 3
        return 1
    else
        return 0
    end
end

for country in passport_data.Passport
    passport_data[!, country] = modifier.(passport_data[!, country])
end

passport_data

199 rows × 200 columns

PassportAfghanistanAlbaniaAlgeriaAndorraAngolaAntigua and BarbudaArgentinaArmeniaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBhutanBoliviaBosnia and HerzegovinaBotswanaBrazilBruneiBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCentral African RepublicChadChileChinaColombiaComorosCongoDR CongoCosta RicaIvory CoastCroatiaCubaCyprusCzech RepublicDenmarkDjiboutiDominicaDominican RepublicEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaSwazilandEthiopiaFijiFinlandFranceGabonGambiaGeorgiaGermanyGhanaGreeceGrenadaGuatemalaGuineaGuinea-BissauGuyanaHaitiHondurasHong KongHungaryIcelandIndiaIndonesiaIranIraqIrelandIsraelItalyJamaicaJapanJordanKazakhstanKenyaKiribatiKosovoKuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacaoMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMauritaniaMauritiusMexicoMicronesiaMoldovaMonacoMongoliaMontenegroMoroccoMozambiqueMyanmarNamibiaNauruNepalNetherlandsNew ZealandNicaraguaNigerNigeriaNorth KoreaNorth MacedoniaNorwayOmanPakistanPalauPalestinePanamaPapua New GuineaParaguayPeruPhilippinesPolandPortugalQatarRomaniaRussian FederationRwandaSaint Kitts and NevisSaint LuciaSamoaSan MarinoSao Tome and PrincipeSaudi ArabiaSenegalSerbiaSeychellesSierra LeoneSingaporeSlovakiaSloveniaSolomon IslandsSomaliaSouth AfricaSouth KoreaSouth SudanSpainSri LankaSaint Vincent and the GrenadinesSudanSurinameSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTimor-LesteTogoTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTuvaluUgandaUkraineUnited Arab EmiratesUnited KingdomUnited StatesUruguayUzbekistanVanuatuVaticanVenezuelaViet NamYemenZambiaZimbabwe
StringInt64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64Int64
1Afghanistan1000000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000010000000000000000000000000000000
2Albania0101010101000011100001010100000000101000001011101110100100011011101000001011101000110000001000100001111001001000011101000000100000110001000001101000001000100111000101010011000000001010001000000100000
3Algeria0010000000000000001000000000000000000000000000001010000000000000000001001010001000000000000000000000000001010010010000100000000000000001000000000000000000000000000000010000100000000100000000000000000
4Andorra0101011101010001110011010100000100101000101011101110100110011011101010001111101001110100001010100001111001001000111101100000111000110001101111111000101100100111001101010011010010000110001110111110000
5Angola0000100000000000001000100000000100000000000000001010000000000000000000001000001000000000000000000000000000000001010000010100000000000000100010000000000100000100001000010000000000000100010000000000011
6Antigua and Barbuda0101010001010011110001110100000000101000101111101110100110111011101110011111101001011000011000101001110011001001011101000000101000110001100111111001101000100111001101010111000100001100011010001110011
7Argentina0101011101010011110011110100000000101000101011101110100110111001101110011111101001111101001010100001110001001001111111100000111000110001101111111101101000100111001101010111000010001110001110111110000
8Armenia0100011100010011000000010000000000000000000000001010000000000001000000001010001100000001000010000000001001000000011001000100000000000001100000000100000000000000000000010000001000000000001000110000000
9Australia0101011111010011110011100100000000101000101011101110100110111011101110011111101001111101011010101001111001001001111101100100111000110001100111111001101000100111001101010011010010000100000110111110000
10Austria0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011100101110111110000
11Azerbaijan0100010000110011000001000000000000001000000000001010000000000001000000001000001100000001000010000000000001000000011001000100000000100001000000010100000000100000000000010000001000000010001000011000000
12Bahamas0101010001010010110001110100000000111000101011101110100110111011101110011111101001111100111000101001110011001001111101000000101000110001100111111001101000100111001101010111000100001000010111101100011
13Bahrain0100000000011001000001100000000000000000000000001111100000000001000010001110001000000010001110010000000001000001010000100000011000001001000010010001000010100100000100010000100010000110000100001000000
14Bangladesh0000000000010110000100000000000000000000000000001000000000100010000100001000001000001000000000001000000000000000010000000000000000000000000000000001000000000000000000010000000000001000000000001000000
15Barbados0101011001010111110001110100000000111000101111101110110110111011101110011111101001111100111000101001110011001001111101000000101000110001100111101001101000100111001101010111000100001100010010101110011
16Belarus0100011100100011000000010000000000010000000100001010000000000011000000001010001000100001000010000000001001000000011011000100001000000001100100010100000000100000000000010000001000000010001000011011000
17Belgium0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011100101110111110000
18Belize0000010000010010010000110000000000101000100000001110100010100011000110011110001001101000111000001000000011000001110000000000001000000001100110000001100000000100001000010100010100001010010010101010011
19Benin0000000000000000001000000010000110000000010000001010000000000010010001101010001000000000000000000100000001010001010000000000000110000000000010000010000001001100001000010000000000100100000000000000000
20Bhutan0000000000000100000100000000000000001000000000001010000000000010000000001010011000000000000000000000000000000000010000000000000000000001100010000000000000000100000000010000000000000000000000000000000
21Bolivia0000001000010000010010010000000000101000100000001110000000000010000000001010001101001000000000000000000001000000010000000000000000000001101110010101000000100100001000010000000000000010000000100010000
22Bosnia and Herzegovina0101000001010001100001010100000000111000001111101110000110011011101000001011101000010000000010100001111001001000011101000000100000110001100001101100101000100111000101010011000000001110001000010100000
23Botswana0000110000010110011000100000000000000000000000001110000010100011000100011010001001101000101000001000000011000001010000010100000000100000100010000001100000000100001100010000000100001000000010001000011
24Brazil0101011101010011110011110100000000101000101011101110100110111001101110011111101001111001001010100001111001001001111111100100111000110001101111111101101100100111001101010111000010001110001110111110000
25Brunei0101010001010010110001101100100000011000101011101110100110111011101110001111101001011100101011101001111001001001011101001000111000110001100111111101101000000111000101010011010110001110001110011101000
26Bulgaria0101011101010011110001111100000100101000101011101110100100111011101110001111101001110101011000100001111001001101111101100000111000110011101111111001111101100111100101010011010001011110101110111110000
27Burkina Faso0000000000000100001000000010000111000000010000001010000000000010010001101010001000000000000000000100000000010000010000000000000110000000000010000000000001001100000000010000000000100100000000000000000
28Burundi0000000000000000001000000001000010000001000000001010000000000000000000001000001000000000100000000000000000000001010000000000000000000000000010000010000000100100000000010000000000000000010000000000000
29Cambodia0000000000000000000000001000100000000000000000001010000000000010000000001000001000000000000001000000000001000000010000001000000000000001100010000000000000000100000000010000000010000000000000000001000
30Cameroon0000000000000000001000000000010011000010000000001010000000000000000100001000000000000000000000001000000000010000010000000000000010000000000010000000000000000100000000010000000000000000000000001000000
31Canada0101011001010011110011101100001000101000101011101110100110111011101110011111101001111101011010101001111001001001111111100100111000110001100111111001101101100111001101010011010010001100001111111110000
32Cape Verde0000000000010000001000000010000100000000010000001010000000000010010001101010001000000000000000000100001001010001010000000000000110000001100010000000000101001100001000010000000000100100000000000000000
33Central African Republic0000000000000000001000000010010011000010010000001010000000000000000000001000000000100000000000000000000000000000010000000000000000000001000010000010000001000100000000010000000000000000000000000000000
34Chad0000000000000000001000000000010011000010010000001010000000000000000000001010001000000000000000000000000001010001010000000000000110000000000010000010000001000100000000010000000000000000000000000000000
35Chile0101011001010011110011110100000000101000101011101110100110111001101110011111101001111101001010100001111001001001111111100000111000110001101111111101101000100111001101010011010010001110001110111111000
36China0100010000010011000001000000000000010000000000001011010000100000000100001000001000001000000000000000000000000001010000100000000000000001000000010001100000100000000000000000000000000100000100001000000
37Colombia0101011001010010110011010100000000101000001011101110100100111001101010010111100000111000001000100001110000001000111101000000100000110001101111111101001000100111000101010011000000001010000000100110000
38Comoros0000000000000000001000000000000000000100000000001010000000000000000000001010001000000000000000000000000011000000010000000000000000000000100010000000000000000100000000010000000000000100010000000000000
39Congo0000000000000000001000000000010011000011010000001010000000000000000000001000000000000000000000000000000000000001010000000000000000000000000010000000000000000100000000010000000000000000000000000000000
40DR Congo0000000000000000001000000001000010000001000000001010000000000000000000001000000000000000000000000000000000000001010000000000000000000000000010000010000001000100000000010000000000000000000000000000001
41Costa Rica0101001001010010110011111100000000101000101011101110100100011001101110011111101001111100001000100001110001001000111101000000101000110001101111111001101000100111001101010011000000001110000010100110000
42Ivory Coast0000000000000000001000000010000111000000010000001010000000000010010001101000001000000000000000000100000000010010010000100000000110000000000010000000000001001100000000010000000000100100000000000000000
43Croatia0101011101010011110011111100000100101000101011101110100110011011101110001111101001110101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010001011100101110111110000
44Cuba0000010000000011000000100000000000000000000100001000000000000010000101010000001000000000000010000000000001000000010011000100000000100001000000010101100000100100000000010000000000001000000000001000000
45Cyprus0101011101010011110001111100000100101000101011101110100110111011101110001111101001111101111000100001111001001101111101100000111000110011101111111001111101100111101101010011010101011000111110111110011
46Czech Republic0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010101001111001001101111101100000111000110011101111111001111101100111101101010011010011011110101110111110000
47Denmark0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111111000
48Djibouti0000000000000000001000000000000000000000000000011010000001000000000000001010000000000000000000000000000000000000010000000000000000000000000010000000000001000100000000010000000000000000000000000000000
49Dominica0001010001010011110001110100000000001000101111101110000110111010101100011011101001111000101000101001111011001001011101000000100000010001100111101101101000100111000101010111000100001000000010101110010
50Dominican Republic0000000000000000010000100000000000001000000000000110100000000011000110010010001000100100000000000000000001000000010000000000000000000001001110010000000000000100000100000000010000001000000000000000000
51Ecuador0000001000010001010010010000000000111000000000001110100000000011000000011110001000101001000000000000000001000000111001000000001000000001101110010101000000000100001100010000000000001010000000100010000
52Egypt0000000000000000001000000000000000000000000000001011000000000000000001001010001100000010000000000000001001000001010000000000000000000001000000000001000000000000000000010000000000000000000000000000000
53El Salvador0101001001010011110001010100000000101000101011101110100100011001101010001111101001111100001000100001110001001000011101000000101000110001101011101101001000000111000101010011000000001010000010100100000
54Equatorial Guinea0000000000000000001000000000010011000010000000001010010000000000000000001010000000000000000000000000000000000000010000000000000000000001000010000000000100000100000000010000000000000100000000000000000
55Eritrea0000000000000000001000000000000000000000000000001000001000000000000000001000000000000000000000000000000000000000010000000000000000000000000010000000000000000100000000010000000000000000010000000000000
56Estonia0101011101010011110011111100000100101000101011101110100110111001101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010011011110101110111110000
57Swaziland0000010000010010011000100000000000000000000000001010000010100010010100011010001001101000101000001000000011000001010000010100000000000001000010000001100000000100001100010000000100001000010000001000011
58Ethiopia0000000000000000001000000000000000000000000000001000000001000000000000001000000000000000100000000000000000000000010000000000000000000000000010000000000000000100000000010000000000000000000000000000000
59Fiji0000011000010110010000010000000000111000100000001110100000100010000010001010001001101000111000001000000011000001010000000000001000000001100110000101100000000100000100010000000000000100010000001000011
60Finland0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111111000
61France0101011101010011110011111100000100101000101011101110100110111001101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111111000
62Gabon0000000000000100001000000000010011000010000000001010000000000100000000001010001000000000000000000000000001000001010000100000000000000000100010000000000100000100001000010000000000000100000000000000000
63Gambia0000000000010110011000100010000100000000010000001010000010100010010101101000001000001000100000001100000011010011010000000000000110000000000010000001000001001100000000010000000100101100010000001000000
64Georgia0101011101110011100001010100000000101000001011101010000100011001101000001001101100110001000010100001110001001001011101000000100000010001100001111000101000100011000001010011001000000011001000110100000
65Germany0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111111100100111000110011101111111001111101100111101101010011010011011110101110111111000
66Ghana0000000000000110011000000010000100000000010000001010000010100010010101101000001000001000100000000100000000010001010000000000000110000000000010000011000001001100000000010000000100101000010000001000001
67Greece0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010100001111001001101111101100000111000110011101111111001111101100111101101010011010011011110101110111110000
68Grenada0001011001010110110001110100000000111000101111101110000110111010101100011011101001111000111000101001111011001001011101000000100000010001100111101101101000100111000101010111000100001000010010101110011
69Guatemala0101001001010000110001010100000000101000101011101110100100011000101010001111101001111100001000100001110001001000011101000000101000110001101111101101001000000111000101010011010000001010000010100110000
70Guinea0000000000000100001000000010000100000000010000001010000000000010010001101010000000000000000000000100000001010000010000000000000110000000000010000010000001001100000000010000000000100100000000000000000
71Guinea-Bissau0000000000000100001000000010000100000000010000001010000000000010010001101000000000000000000000000100000000010000010000000000000110000000000010000000000101101100000000010000000000100100000000000000000
72Guyana0000011000010010010000110000000000101000100000001110000010100010000100011010001001001000001000001000000001000001010000000000000000000001100110010101100000000100001100010100000100001000000000101000000
73Haiti0000000000000010001000000000000000000000000000001010000000000010000000011010001000100000000000000000000001000000010000000000000000000001000010000010000000000100000100010000010000000000000000000000000
74Honduras0101001001010000110001010100000000101000101011101110100100011011101010001111101001110100001000100001110001001000011101000000101000110001101111101101001000000111000101010011010000001110000110100100000
75Hong Kong0101011101010011111001111100000100101000001011101111000100111000101100011011101001111101011000101001111011001001111111101100111100110001100111111101101000100111001101010111000110001110011110101110111
76Hungary0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111101101010011010011011110101110111110000
77Iceland0101011101010011110011111100000100101000101011101110100100111011101110001111101001111101011010101001111001001001111101100100111000110001101111111001101100100111101101010011010011011110101110111110000
78India0000000000000000000100000000000000000000000000001010100000100000000100001000011000001000000000000000001000000001010000000001000000000001000000010001000001100000000000010000000000001100000000001000000
79Indonesia0000000000000001000000011000100000101000000000001010000000100010000000011010001000000100000001000000001001010000010000101100000000000001000110010011000000100100000000010000000010000000000000010001000
80Iran0000000100000000000000000000000000000000000000001010000000000001000000001000000100000000000000000000000001000000010000000000000000000000000000000000000000000000000000000000000000000010000000000010000
81Iraq0000000000000000000000000000000000000000000000001010000000000000000000001000000010000000000000000000000001000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000
82Ireland0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110001101111111001101101100111001101010011010010001100001110111110010
83Israel0101001001010011110001110100000010101000101011101110100110111001101110001111100001111101001000101001111010001001111111000000111000110011101111101101101000100111001101010111010010001010001010111100000
84Italy0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111111000
85Jamaica0000011000010110010000110000000000101000000000001110000010100010000100011010001000101000110000001000000011000001110000000100000000000001100110000101100000100100001100010100000100001000010000101010011
86Japan0101011101010011110011101100000000111000101011101110100110111001101110011111101001111101011011101001111001001001111111101100111000110001101111111001101101100111001101010111010010001110001110111111000
87Jordan0000000000000000000000000000000000000000000000001011000000000001000000001010001000000010001000010010000001000000010000000000000000000001000000000001000000000000001000000000100000000110000000000000000
88Kazakhstan0100011100100011000000010000000000001000100000001110000000000001000000001010001000000001000010000000000001000000011011000100000000000001000010010100000000100000000100010000001000000010001000010000000
89Kenya0000010000010010001000100001000000000000000100001000000011100010010100001010001000001000110000001000000011000001010000000100000000000000100010000011000000000100000000010000000100001000010000001000011
90Kiribati0001010001010010110001100100000000000000101011101110000100111010101100001011101001011000111000101001111011001001011100000000100000010001100111101001101000000111000101010011000100001100000010001100011
91Kosovo0100000000000000000000000000000000000000000000001010000000000010000000001000000000000000001000000000000000000000010001000000000000100001000000000000000000100000000000010000000000000010000000000000000
92Kuwait0100000000011001000001100000000000000000000000001111100010000001000010001110001000000010001110010000000001000001010001100000011000001001100010010001100110100100000100011000100010000110000100001000000
93Kyrgyzstan0000010100100011000000000000000000000000000000001010000000000001000000001000001000000001000010000000000001000000011010000100000000000001000010000100000000100000000000010000001000000010001000010001000
94Laos0000000000000000000000001000100000000000000000001010000000000010000000001000001000000000000001000000000001000000010010001000000000000001000010000100000000000100000000010000000010000000000000000001000
95Latvia0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010011011110101110111110000
96Lebanon0000000000000000000000000000000000000000000000001010000000000001000000001000001100000010000000010000001001000000010000000000000000000001000000010000000000000000000000000000100000000010000000000000000
97Lesotho0000010000010110011000100000000000000000000000001010000010100010000100011010001001101100111000001000000011000001010000000100000000000001000010000001100000000100001100010000000100001000010000001000011
98Liberia0000000000000000001000000010000110000000010000001010000000000010010001101000000000000000000000000100000000010000010000000000000110000000000010000000000001001100000100010000000000100000000100000000000
99Libya0010000000000000001000000000000000000000000000001010000000000000000000001000000000000000000000000010000001000010010000000000000000000001000000000000000000000000000000010000000000000100000000000000000
100Liechtenstein0101011101010011100011111100000100101000101011101110100100111011101110001111101001111100011010100001111001001001111101100100111000110001101111111001101100100111101101010011010011011110101110111110000
101Lithuania0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010011011110101110111110000
102Luxembourg0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011011101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111110000
103Macao0101010101000011100001011100000100110000001011101111000100111000101100001011101001110100011000100001111001011001111111101100111000110001000011101101011000100111001101010011000110000010000010101100000
104Madagascar0000010000000000001000000000000000000000000000001010100010000000000010001110001000000000000000000000000101000000010000000000001000000000100010000000000000000100000000010000000100000000010000000000001
105Malawi0000010000010110011000100000000000000000000000001010000010100010000100001010001000101000111000001000000011000001010000010100000000000001000010000001100000000100001000010000000100001000010000001000011
106Malaysia0111011001010011110001111100100000100000101111101110100110111011101110011111101101011101111011101001111011001001111111100100111000110001100111111001001000000111001101010111010110001110000110111111011
107Maldives0000010000010110010100101000000000000000100000001010000010100010000100001010011001001000101000001000000001100001010000000000000000000101100010010001100000000100001000010000000010001100000010001000011
108Mali0010000000010010001000000010010101000000010000001010000000000010010001101010001000000000000000000100001000010010010000000000000110000000000010000000000001001000000000010000000000100100000000000000000
109Malta0101011101010011110001111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111101101010011010101011100111110111110011
110Marshall Islands0001010001010000110001000100000000001000101011101110100100111000101010001111101000010000011000100001110001001100111100000000101000010011100111101000101000000111000101010011010000000000000011001100010
111Mauritania0010000000000010001000000010000101000000010000001010000000000010000001001010001000000000000000000000000001010010010000000000000100000000000010000000000001001100000000010000100000000100000000000000000
112Mauritius0101110001010010111001100100000000110000101011101110000110111111111100001011101000111100111000101001111011001001011101010100110000110001100011101111101001000111001101010011000110001100010010001100011
113Mexico0101011001010011110011110100000000101000101011101110100100111001101110001111101001111101001000100001111001001001111101100000111000110001101111111001101000100111000101010011000000001100000110101110000
114Micronesia0001000001000001110001000100000000001000101011101110000100111010101000001011100000110000011000100001110000001100111100000000100000010011100111101000101000000111000101010011000000000000000011001100000
115Moldova0101010101110011100001000100000000101000001011101010000100111001101000001001101000110001000010100001111001001000011101000100100000110001100101111101001000100011000001010011001000000110001000010100000
116Monaco0101011101010001110011110100000100101000101011101110100110111011101110001111101001111101001010100001111001001001111101100000111000110001101111111001101100100111001101010011010010000110001110111110000
117Mongolia0000000000000001000000010000000000110000000100001010000000000000000000001010001000100001000011000000001001000000010010000000000000000001100010000100000000100100000000010000000010000010001000110000000
118Montenegro0101001101000001100001010100000000101000101111101010000110011011101000001011100000110000001010100001111000001000011101000000100000110001100101101100101000100111000101010011000000001110001100110100010
119Morocco0010000000000000011000010000000000000000010000001010000000000110000101001010001000000000000000000000001001010000010000100000000100000001000010000000000101000000000100010000100000000110000000001000000
120Mozambique0000100000000000001000100000000000000000000000001010000010000000000100001010001000001000000000000000000010000001010000010100000000000000000010000000000100000100001000010000000100000000000000001000011
121Myanmar0000000000000000000000001000000000000000000000001010000000000000000000001000001000000000000001000000000000000000010000001000000000000000000010000000000000000100000000010000000010000000000000000001000
122Namibia0000110000010000011000110000000000000000000100001110000010000010000100001010001000001000101000001000001011000001010000000100000000000000100010000000000000000100001000010000000100001100000010001000011
123Nauru0000010000010000000000100000000000000000100000001110000010100010000100001010001001101000111000001000000011000001010000000010000000000001100100000101100000000100000100010000010100001000000010001000001
124Nepal0000000000000000000000000000000000000000000000001000000000000010000000001000011000000000000000000000000000000000010000000001000000000101000010000000000000000100000000010000000000000000000000000000000
125Netherlands0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011100101110111110000
126New Zealand0101011111010011110011111100000000101000101011101110100110111011101110011111101001111101011010101001111001001001111101100100111000111001100111111001101000100111000101010011010010000110000110111110000
127Nicaragua0101001001010011110001010100000000100000001011101110100100011000101010001101101001010000001000100001110001001000011101000000101000110001101011101101001000000111000101010011010000001010000010100100000
128Niger0000000000000000001000000010000111000000010000001010000000000010010001101010000000000000000000000100000000010010010000100000000110000000000010000000000001001100000000010000000000100100000000000000000
129Nigeria0000000000000010001000000010010101000000010000001000000000100010010001101000000000000000000000000100000000010000010000000000000110000000000000000001000001001000000000000000000000100000000000001000000
130North Korea0000000000000001000000000000000000000000000000001000000000000010000000011000000000000000000010000000000000000000010000000000000001000001000000000000000000000000000000010000000000000000000000000000000
131North Macedonia0101011001010001100001010100000000101000001111101110100100011010101010001111101000110100001000100001111001001000011101000000101000110001100101111000001000100111000001010011010000000110001000000100000
132Norway0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110001101111111001101100100111101101010011010011011100101110111111000
133Oman0000000000011001000001101000000000000000000000001011000000000001000000001010001000000010001110010000000001000001010000100000010000001001000010010000000010100100000100010000100010000100000100001000000
134Pakistan0000000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000000000010000000000000000000100000000010000000000000000000000010000000000001000000000001000000
135Palau0001000001000000110001000100000000001000101011101010000100111010101000001011101000110000011000100001110001001100111100000000100000010011100111101100001000000111000101010011010000000000000011001100000
136Palestine0000000000000000000010000000000000000000000000001010000010000000000000000000001000000010000000000000000001000000010000000000001000000001000000000000000000000000000000010000000000000000000000000010000
137Panama0101011001010011110011010100000000101000101011101110100100011001101010010111101001111000001000100001110001001000111101000000101000110001101111111101101000000111001101010011000000001010001010100100000
138Papua New Guinea0000010000010100010000100000000000001000000000001110000010100010000100001010001000101000101000001000000001000001010000000000000000000001110110000001000000000100000000010000000100000000000010001000000
139Paraguay0101001001010000110011110100000000101000101011101110100100111000101010001111101001111000001000100001110001001001111101000000101000110001101111111101001000100111001101010011010000000010001110100110000
140Peru0101011001010011110011111100000000101000101011101110000100111000101010011111101000111000000000100001110001001000111101100000100000110001101111111101001000100111001101010011000010001010000000101110000
141Philippines0000000000000000000010011000100000001000110000001010000000100010000000001010001000100000000001000000001001000000010010101000000000000001000110000010000000000100000000010100010010000000000000001001000
142Poland0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111101101010011010011011100101110111110000
143Portugal0101011101010011110011111100000100101000101011101110100110111001101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011100101110111110000
144Qatar0100001100010001000001100000000000011000100000001110100010000001000010001110001000000010001100010000000001000001010001100000011000001001100010010001000100100100000100011000100010000110001000001000000
145Romania0101011101010011110001111100000100101000101011101110100100111011101110001111101001110101011000100001111001001101111101100000111000110011101111111001111101100111100101010011010101011110101110111110010
146Russian Federation0100011100110011000011111000000000101000100100001110100010100011000110011110001000101001000011000000001001000001011011100100001000100011101110010101110100110000001100010000011010001110001100111011000
147Rwanda0000100000000000001000000001000010000001000000001010000000000000000100001000001000000000100000000000000000000001010000000000000000000001000010000010000100000100000000010000000100000000010000001000000
148Saint Kitts and Nevis0101011001010110110001110100000000101000101111101110100100111010101110011111101001111000111000101001110011001001011101000000101000110001100111101101101000100111000101010111010100001110001010101110011
149Saint Lucia0001011001010010110001100100000000101000101111101110100110111010101110011111101001111000111000101001110011001001011101000000101000010001100111101001101000000111000101010111010100001100000010001110011
150Samoa0001010001010110110001100100000000001000101011101010000110111010101100001011101001011000111000101001111011001001011101000000100000010101100111101100111000000111000101010011000100001000000010001100011
151San Marino0101011101010011100001110100000100111000101011101110100110011011101110001111101001111100101010101001111001001001111101100000111000110001100111111000101100100111001101010011010010000110001110111110000
152Sao Tome and Principe0000000000010000001000000000000000000000100000001010100000000000000010001110001000000000001000000000000001000000010000000000001000000001100010000010000100000100000000010000000000000000000000000000000
153Saudi Arabia0100000000001001000000100000000000000000000000001011100000000001000010001110001000000010001110010000000001000001010000100000011000001001100010010001000010000000000100010000100000000100000100001000000
154Senegal0000000000000000001000000010000111000000010000001000000000000010010001101000001000000000000000000100000001010010010000100000000110000001000010000010000001001100000000010000000000100100000000000000000
155Serbia0101001001000001100001010100000000111000101111101110000110111011101000001011101000110101001010100001111000001000011111000000100000110001100101101100001000100111000101010111000000001110001000111100010
156Seychelles0111110001010111111001110100000000010000111011101110000110111011101100001011101001011000111000101001111011001001011101000100110010110001100011111111101000110111001101010011000100001110010110101100011
157Sierra Leone0000000000010110011000100010000100000000010000001010000010100010010101101000000000001000110000001100000001010001010000000000000110000000000000000001000001001100000000010000000000101000010100001000000
158Singapore0101111101010011110001111110100100111000111111111110100110111011111111001111101001111101111011101001111001001001111111101100111000110001101111111011101001100111001101010011010110001110010110111101011
159Slovakia0101011101010011110011111100000100101000101011101110100110111001101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010011011110101110111110000
160Slovenia0101011101010011110011111100000100101000101011101110100110111011101110001111101001111101011010100001111001001101111101100000111000110011101111111001111101100111100101010011010011011110101110111110000
161Solomon Islands0001010001010010110001100100000000001000101011101110100110111010101110001101101001111000111000101001110001001001011100000000101000010001100111101001101000000111100101010011000100001000010010001100011
162Somalia0000000000000000001000000000000000000000000000001000000000000000000000001000000000000000000000000000000001000000010000000000000000000001000000000000000000000000010000010000000000000000000000000000000
163South Africa0000111000010010011000110000000000100000100000001110100010100001000110011110001001101000101000001000001011000001010000010100001000000001101110010101100000000100001100010000000110001100000000101010011
164South Korea0101011101010011110001111100000000101000101011101110100110111011101110011111101001111101011011101101111001001001111101101000111000110001101111111101101101100111001101010111010010001110001110111111000
165South Sudan0000000000000000001000100001000000000000000000001010000000000000000000001000000000000000000000000000000001000000010000000000000000000001000000000010000000000100000010010000000000000000000000000000000
166Spain0101011101010011110011111100000100101000101011101110100110111001101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011100101110111111000
167Sri Lanka0000000000010010000000000000000000000000000000001010000000000010000100001000001000000000000000001000000000000000010000000000000000000000000000000001000000000100000000110000000000000000000000001000000
168Saint Vincent and the Grenadines0001011001010011110001110100000000101000101111101110100100111011101110011111101001111000111000101001110011001001011101000000101000010001100111101101101000100111001101010111010100001000010110101110011
169Sudan0000000000000000001000000000000000000000000000001010000000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000100000000000000000000000000
170Suriname0000011000010010010000010000000000001000100000001110000000000010000100011010001000101100000000000000000001000001010000000000000000000001000110010101100000100100000100010100000000001000000000000000000
171Sweden0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110011101111111001111101100111101101010011010011011110101110111111000
172Switzerland0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011011101001111001001001111101100100111000110001101111111001101100100111101101010011010011011110101110111110000
173Syria0000000000000000000000000000000000000000000000001010000000000000000000001000000100000000000000000000000001000000010000000000000000000001000000000000000000000000000000001000100000000000000000000000000
174Taiwan0101010001000010110001000100000000101000101011101110000110111010101010001101101001110100011000100001111001001100010101000000111000110001101101101001101000000111000101010011010000000000100010101100000
175Tajikistan0000010100100011000000000000000000000000000000001010000000000001000000001000001000000001000010000000000001000000011000000100000000000001000010000100000000000000000000010000001000000010001000010000000
176Tanzania0000010000010110011000100001000000000000000000001010000010100010000101001010001000001000100000001000001011000001010000010100000000000000000010000011100000000100001000010000000100000000010000001000011
177Thailand0100001000000000000000011000100000100000000000001110000000100001000000001010001000000100000001000000001001000000010010001000000000000001100110010100000000000100001100010000010010000010000000001001000
178Timor-Leste0001000001000010100001000100000000000000001011101010000110011010101000001011101000010000001000100001110001001000011101000000100000010001000001101000001100000111000001010011000001000000000010000100000
179Togo0000000000000000001000000010000101000000010000001010000000000010010001101000001000000000000000000100000001010000010000000000000110000000000010000000000001001100000000010000000000100000000000000000000
180Tonga0001000001010110110001100100000000110000101011101110000110111010101100001011101001111000111000101001110001001001011100000000100000010101100101101001101000000111000101010011000100011000010010001100011
181Trinidad and Tobago0101011001010010110001110100000000101000101011101110100110111010111110011111101001111000111000101001110011001001111101000000101000010101100111101001101000100111001101010111000100001010000010101110011
182Tunisia0010000000000010011000010000000000000000010000001010000000100100000001001010001000000100010000000010000001010011010000100000000100000001000010000000000001100000000100010000100000000110000000001000000
183Turkey0100011000010011010011111000000000101000100000001110100010100011000010001110001110001111001010000000001001000001011011100000001000100001101110010001100100100100001100010000000010001110001000111010000
184Turkmenistan0000010000000010000000000000000000000000000000001010000000000011000000001000001000000000000000000000000001000000010000000100000000000001000010000000000000000000000000010000000000000011000000000000000
185Tuvalu0001010001010010110001100100000000000000101011101110100110111010101110001111101001011000111000101001110011001001010100000000101000010001100101101001101000000111000101010011010100001000100010001100011
186Uganda0000010000010010011000100001000000000000000000001010001010100010000100001010001000001000100000001000000011000001010000000000000000000000000010000011000000000100000000010000000100000000010000001000011
187Ukraine0101011101100011100001011100000000100000101011101110100110111001101010001111101000111001000010100001110001001001011111000100101000110001101101111101001000100011000001010011001010000010001100111100000
188United Arab Emirates0101011101011011100001111110000001111000101011101111100110111011101110001111101001010111001110110001110001011001111111100010111000111001100011111101101110110111100111011011100010010100001100111100000
189United Kingdom0101011101010011110011111100000100101000101011101110100110111011101110011111101001111101011010101001111001001101111101100100111000110001101111111001101101100111001101010011010010001100001110111111000
190United States0101011101010011110001101100001010101000101011101110110110111001101110011111101001111101011010101001111001001101111111100100111000110011100111111001101101100111001101010011010010001100001111101100000
191Uruguay0101001101010011110011110100000000101000101011101110100110111001101010011111101001111100001000100001111001001000111111000000111000110001101111111101101000100111001101010011000000001010001110101110000
192Uzbekistan0000010100100011000000000000000000000000000000001010000000000001000000001000001000000001000010000000000001000000011000000100000000000001000010000100000000000000000000010000001000000010001000010000000
193Vanuatu0001010001010011110001100100000000000000101011101110100110111010101110001111101001111000111000101001110001001001011101000000101000010001100111101101101000000111000001010011000100001000010010001100011
194Vatican0101011101010011110011110100000100101000101011101110100110111011101110001111101001110000001010100001110001001001011101000000111000110001100111111001001100100111000101010011010000000110001110111100000
195Venezuela0101011001010011110011110100000000101000101011101110000100111010101100001011101100011000001000100001110001001000111101000000101000110001001111111101001000000111001101010011000000001010000000100110000
196Viet Nam0000000000000000000000001000100000100000000000001010000000000000000000001000001000000000000011000000000001000000010000001000000000000001100010000000000000000100000000010000000010000000000000000001000
197Yemen0000000000000000000000000000000000000000000000001010000000000000000000001000000000000000000000000000000001000000010000000000000000000001000000000000000000000000000000011000100000000000000000000000100
198Zambia0000110000010110011000100000000000000000000000001010000010100010000100001010001000001000110000001000000011000001010000010100000000000000000010000001100000000100001000010000000100001000010000001000011
199Zimbabwe0000100000010010011000100000000000000001000000001010000010100010010000001010001000000000110000001000000011000001010000010100000000000001000010000001000000000100001000010000000100001000010000001000011

The values in the cells now represent:

  • 1 = no visa required for travel
  • 0 = visa required for travel

JuMP Modeling

To model the problem as a mixed-integer linear program, we need a binary decision variable $x_c$ for each country $c$. $x_c$ is $1$ if we select passport $c$ and $0$ otherwise. Our objective is to minimize the sum $\sum x_c$ over all countries.

Since we wish to visit all the countries, for every country, we must own at least one passport that lets us travel to that country visa free. For one destination, this can be mathematically represented as $\sum_{c \in C} a_{c,d} \cdot x_{d} \geq 1$, where $a$ is the passport_data dataframe.

Thus, we can represent this problem using the following model:

\[\begin{aligned} \min && \sum_{c \in C} x_c \\ \text{s.t.} && \sum_{c \in C} a_{c,d} x_c \geq 1 && \forall d \in C \\ && x_c \in \{0,1\} && \forall c \in C. \end{aligned}\]

We'll now solve the problem using JuMP:

using JuMP
import GLPK

First, create the set of countries:

C = passport_data.Passport
199-element Vector{String}:
 "Afghanistan"
 "Albania"
 "Algeria"
 "Andorra"
 "Angola"
 "Antigua and Barbuda"
 "Argentina"
 "Armenia"
 "Australia"
 "Austria"
 ⋮
 "Uruguay"
 "Uzbekistan"
 "Vanuatu"
 "Vatican"
 "Venezuela"
 "Viet Nam"
 "Yemen"
 "Zambia"
 "Zimbabwe"

Then, create the model and initialize the decision variables:

model = Model(GLPK.Optimizer)
@variable(model, x[C], Bin)
@objective(model, Min, sum(x))
@constraint(model, [d in C], passport_data[!, d]' * x >= 1)
model
A JuMP Model
Minimization problem with:
Variables: 199
Objective function type: AffExpr
`AffExpr`-in-`MathOptInterface.GreaterThan{Float64}`: 199 constraints
`VariableRef`-in-`MathOptInterface.ZeroOne`: 199 constraints
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: GLPK
Names registered in the model: x

Now optimize!

optimize!(model)

We can use the solution_summary function to get an overview of the solution:

solution_summary(model)
* Solver : GLPK

* Status
  Termination status : OPTIMAL
  Primal status      : FEASIBLE_POINT
  Dual status        : NO_SOLUTION
  Message from the solver:
  "Solution is optimal"

* Candidate solution
  Objective value      : 23.0
  Objective bound      : 23.0

* Work counters
  Solve time (sec)   : 0.00302

Solution

Let's have a look at the solution in more detail:

println("Minimum number of passports needed: ", objective_value(model))
Minimum number of passports needed: 23.0
println("Optimal passports:")
for c in C
    if value(x[c]) > 0.5
        println(" * ", c)
    end
end
Optimal passports:
 * Afghanistan
 * Angola
 * Australia
 * Austria
 * Comoros
 * Congo
 * Eritrea
 * Gambia
 * Georgia
 * Hong Kong
 * India
 * Iraq
 * Kenya
 * Madagascar
 * Maldives
 * North Korea
 * Papua New Guinea
 * Singapore
 * Somalia
 * Sri Lanka
 * Tunisia
 * United Arab Emirates
 * United States

Interesting! We need some passports, like Australia and the United States, which have widespread access to a large number of countries. However, we also need passports like North Korea which only have visa-free access to a very limited number of countries.

Note

We use value(x[c]) > 0.5 rather than value(x[c]) == 1 to avoid excluding solutions like x[c] = 0.99999 that are "1" to some tolerance.


Tip

This tutorial was generated using Literate.jl. View the source .jl file on GitHub.