Spaces:
Runtime error
Runtime error
first commit
Browse files- COVID_Restrictions.py +143 -0
- data/.DS_Store +0 -0
- data/GoogleDevCountryGeoCoords.csv +246 -0
- data/US-Outbound-to-World-Regions_2021.xlsx +0 -0
- data/US-Outbound-to-World-Regions_2022.xlsx +0 -0
- data/air-passengers-carried.csv +0 -0
- data/all.csv +250 -0
- data/hotel_booking_2019_2020.csv +0 -0
- data/international-travel-covid.csv +0 -0
- data/tsa.xlsx +0 -0
- data/unwto-tourism-industries-data.xlsx +0 -0
- pages/Lodging.py +183 -0
- pages/Plane Travel.py +192 -0
COVID_Restrictions.py
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
import altair as alt
|
5 |
+
from vega_datasets import data
|
6 |
+
|
7 |
+
st.set_page_config(layout="wide")
|
8 |
+
st.markdown('# COVID Restrictions')
|
9 |
+
st.markdown("""
|
10 |
+
A look into the COVID restrictions currently in place in countries around the world to determine the requirements to succesfully enter a certain country.
|
11 |
+
Also, can access the history of COVID regulations in each country.
|
12 |
+
""")
|
13 |
+
|
14 |
+
df = pd.read_csv(r'./data/international-travel-covid.csv')
|
15 |
+
df["Day"] = pd.to_datetime(df["Day"])
|
16 |
+
codes = pd.read_csv('./data/all.csv')
|
17 |
+
df["id"] = 0
|
18 |
+
df.rename(columns={'international_travel_controls': 'restrictions'}, inplace=True)
|
19 |
+
|
20 |
+
# %%
|
21 |
+
#codes.head()
|
22 |
+
|
23 |
+
# %%
|
24 |
+
for index, row in codes.iterrows():
|
25 |
+
df.loc[(df['Code'] == row["alpha-3"]),'id'] = row["country-code"]
|
26 |
+
|
27 |
+
# %%
|
28 |
+
df['restrictions'] = df['restrictions'].replace([0,1,2,3,4],
|
29 |
+
["No measures","Screening","Quarantine from high-risk regions","Ban on high-risk regions","total border closure"])
|
30 |
+
|
31 |
+
# %%
|
32 |
+
#df.head(15)
|
33 |
+
|
34 |
+
# %%
|
35 |
+
#df.dtypes
|
36 |
+
|
37 |
+
# %%
|
38 |
+
df['year'] = df.Day.map(lambda x: x.year)
|
39 |
+
df['month'] = df.Day.map(lambda x: x.month)
|
40 |
+
df['day'] = df.Day.map(lambda x: x.day)
|
41 |
+
|
42 |
+
# %%
|
43 |
+
df_first = df[df["day"] == 1]
|
44 |
+
|
45 |
+
# %%
|
46 |
+
#drop anything before 2023
|
47 |
+
df_first = df_first[(df_first["Day"] < '2023-01-01')]
|
48 |
+
|
49 |
+
# %%
|
50 |
+
#df_first
|
51 |
+
|
52 |
+
# %%
|
53 |
+
alt.data_transformers.disable_max_rows()
|
54 |
+
|
55 |
+
source = alt.topo_feature(data.world_110m.url, "countries")
|
56 |
+
|
57 |
+
background = alt.Chart(source).mark_geoshape(fill="white")
|
58 |
+
|
59 |
+
years=list(df_first['year'].unique())
|
60 |
+
years.sort()
|
61 |
+
|
62 |
+
selectorYear = alt.selection_single(
|
63 |
+
name='Y',
|
64 |
+
fields=['year'],
|
65 |
+
init={"year":years[0]},
|
66 |
+
bind=alt.binding_select(options=years, name="Year: ")
|
67 |
+
)
|
68 |
+
|
69 |
+
months=list(df_first['month'].unique())
|
70 |
+
months.sort()
|
71 |
+
|
72 |
+
selectorMonth = alt.selection_single(
|
73 |
+
name='Months',
|
74 |
+
fields=['month'],
|
75 |
+
init={"month":months[0]},
|
76 |
+
bind=alt.binding_select(options=months, name="Month: "),
|
77 |
+
)
|
78 |
+
|
79 |
+
highlight = alt.selection_single(fields=['restrictions'], bind='legend')
|
80 |
+
opacityCondition = alt.condition(highlight, alt.value(1.0), alt.value(0.2))
|
81 |
+
|
82 |
+
foreground = alt.Chart(df_first,title="The COVID restrictions in each country on the 1st of the month").mark_geoshape(
|
83 |
+
stroke="black", strokeWidth=0.15
|
84 |
+
).encode(
|
85 |
+
alt.Color(
|
86 |
+
"restrictions:N",
|
87 |
+
scale=alt.Scale(domain=["No measures","Screening","Quarantine from high-risk regions","Ban on high-risk regions","total border closure"],
|
88 |
+
range=['#ffffcc','#fbec5d','#ffbf00','#ff4d00','#e62020']),
|
89 |
+
legend=alt.Legend(title="", orient="top")
|
90 |
+
|
91 |
+
)
|
92 |
+
,tooltip=[alt.Tooltip('Entity:N', title="Country"), alt.Tooltip('restrictions:N', title="Restrictions")],
|
93 |
+
opacity=opacityCondition
|
94 |
+
).transform_lookup(
|
95 |
+
lookup='id',
|
96 |
+
from_=alt.LookupData(source, key='id',
|
97 |
+
fields=["type", "properties", "geometry"])
|
98 |
+
).project("naturalEarth1").transform_filter(
|
99 |
+
selectorYear & selectorMonth
|
100 |
+
)
|
101 |
+
|
102 |
+
foreground = foreground.add_selection(selectorYear, selectorMonth, highlight).properties(width=700, height=400)
|
103 |
+
foreground
|
104 |
+
|
105 |
+
# %%
|
106 |
+
alt.renderers.set_embed_options(
|
107 |
+
padding={"left": 0, "right": 0, "bottom": 0, "top": 0}
|
108 |
+
)
|
109 |
+
selectorYear2 = alt.selection_single(
|
110 |
+
name='Years',
|
111 |
+
fields=['year'],
|
112 |
+
init={"year":years[0]},
|
113 |
+
bind=alt.binding_radio(options=years,name="Year: ")
|
114 |
+
#bind=alt.binding_select(options=years, name="Year")
|
115 |
+
)
|
116 |
+
highlight2 = alt.selection_single(fields=['restrictions'], bind='legend')
|
117 |
+
opacityCondition = alt.condition(highlight, alt.value(1.0), alt.value(0.2))
|
118 |
+
monthNames = ["","January","February","March","April","May","June","July","August","September","October","November","December"]
|
119 |
+
facet = alt.concat(*(
|
120 |
+
alt.Chart(df_first[df_first["month"] == month], title=monthNames[month]).mark_geoshape(
|
121 |
+
stroke="black", strokeWidth=0.15
|
122 |
+
).encode(
|
123 |
+
alt.Color(
|
124 |
+
"restrictions:N",
|
125 |
+
scale=alt.Scale(domain=["No measures","Screening","Quarantine from high-risk regions","Ban on high-risk regions","total border closure"],
|
126 |
+
range=['#ffffcc','#fbec5d','#ffbf00','#ff4d00','#e62020']),
|
127 |
+
legend=alt.Legend(title="", orient="top")
|
128 |
+
)
|
129 |
+
,tooltip=[alt.Tooltip('Entity:N', title="Country"), alt.Tooltip('restrictions:N', title="Restrictions")],
|
130 |
+
opacity=opacityCondition
|
131 |
+
).transform_lookup(
|
132 |
+
lookup='id',
|
133 |
+
from_=alt.LookupData(source, key='id',
|
134 |
+
fields=["type", "properties", "geometry"])
|
135 |
+
).project("naturalEarth1").transform_filter(
|
136 |
+
selectorYear2
|
137 |
+
).add_selection(selectorYear2, highlight)
|
138 |
+
for month in range(1,13)
|
139 |
+
), columns=3
|
140 |
+
).properties(background = '#f9f9f9',
|
141 |
+
title = alt.TitleParams(text = 'The COVID restrictions throughout the different months of the year')
|
142 |
+
)
|
143 |
+
facet
|
data/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
data/GoogleDevCountryGeoCoords.csv
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name,country,latitude,longitude
|
2 |
+
Andorra,AD,42.546245,1.601554
|
3 |
+
United Arab Emirates,AE,23.424076,53.847818
|
4 |
+
Afghanistan,AF,33.93911,67.709953
|
5 |
+
Antigua and Barbuda,AG,17.060816,-61.796428
|
6 |
+
Anguilla,AI,18.220554,-63.068615
|
7 |
+
Albania,AL,41.153332,20.168331
|
8 |
+
Armenia,AM,40.069099,45.038189
|
9 |
+
Netherlands Antilles,AN,12.226079,-69.060087
|
10 |
+
Angola,AO,-11.202692,17.873887
|
11 |
+
Antarctica,AQ,-75.250973,-0.071389
|
12 |
+
Argentina,AR,-38.416097,-63.616672
|
13 |
+
American Samoa,AS,-14.270972,-170.132217
|
14 |
+
Austria,AT,47.516231,14.550072
|
15 |
+
Australia,AU,-25.274398,133.775136
|
16 |
+
Aruba,AW,12.52111,-69.968338
|
17 |
+
Azerbaijan,AZ,40.143105,47.576927
|
18 |
+
Bosnia and Herzegovina,BA,43.915886,17.679076
|
19 |
+
Barbados,BB,13.193887,-59.543198
|
20 |
+
Bangladesh,BD,23.684994,90.356331
|
21 |
+
Belgium,BE,50.503887,4.469936
|
22 |
+
Burkina Faso,BF,12.238333,-1.561593
|
23 |
+
Bulgaria,BG,42.733883,25.48583
|
24 |
+
Bahrain,BH,25.930414,50.637772
|
25 |
+
Burundi,BI,-3.373056,29.918886
|
26 |
+
Benin,BJ,9.30769,2.315834
|
27 |
+
Bermuda,BM,32.321384,-64.75737
|
28 |
+
Brunei,BN,4.535277,114.727669
|
29 |
+
Bolivia,BO,-16.290154,-63.588653
|
30 |
+
Brazil,BR,-14.235004,-51.92528
|
31 |
+
Bahamas,BS,25.03428,-77.39628
|
32 |
+
Bhutan,BT,27.514162,90.433601
|
33 |
+
Bouvet Island,BV,-54.423199,3.413194
|
34 |
+
Botswana,BW,-22.328474,24.684866
|
35 |
+
Belarus,BY,53.709807,27.953389
|
36 |
+
Belize,BZ,17.189877,-88.49765
|
37 |
+
Canada,CA,56.130366,-106.346771
|
38 |
+
Cocos [Keeling] Islands,CC,-12.164165,96.870956
|
39 |
+
Congo [DRC],CD,-4.038333,21.758664
|
40 |
+
Central African Republic,CF,6.611111,20.939444
|
41 |
+
Congo [Republic],CG,-0.228021,15.827659
|
42 |
+
Switzerland,CH,46.818188,8.227512
|
43 |
+
Côte d'Ivoire,CI,7.539989,-5.54708
|
44 |
+
Cook Islands,CK,-21.236736,-159.777671
|
45 |
+
Chile,CL,-35.675147,-71.542969
|
46 |
+
Cameroon,CM,7.369722,12.354722
|
47 |
+
China,CN,35.86166,104.195397
|
48 |
+
Colombia,CO,4.570868,-74.297333
|
49 |
+
Costa Rica,CR,9.748917,-83.753428
|
50 |
+
Cuba,CU,21.521757,-77.781167
|
51 |
+
Cape Verde,CV,16.002082,-24.013197
|
52 |
+
Christmas Island,CX,-10.447525,105.690449
|
53 |
+
Cyprus,CY,35.126413,33.429859
|
54 |
+
Czech Republic,CZ,49.817492,15.472962
|
55 |
+
Germany,DE,51.165691,10.451526
|
56 |
+
Djibouti,DJ,11.825138,42.590275
|
57 |
+
Denmark,DK,56.26392,9.501785
|
58 |
+
Dominica,DM,15.414999,-61.370976
|
59 |
+
Dominican Republic,DO,18.735693,-70.162651
|
60 |
+
Algeria,DZ,28.033886,1.659626
|
61 |
+
Ecuador,EC,-1.831239,-78.183406
|
62 |
+
Estonia,EE,58.595272,25.013607
|
63 |
+
Egypt,EG,26.820553,30.802498
|
64 |
+
Western Sahara,EH,24.215527,-12.885834
|
65 |
+
Eritrea,ER,15.179384,39.782334
|
66 |
+
Spain,ES,40.463667,-3.74922
|
67 |
+
Ethiopia,ET,9.145,40.489673
|
68 |
+
Finland,FI,61.92411,25.748151
|
69 |
+
Fiji,FJ,-16.578193,179.414413
|
70 |
+
Falkland Islands [Islas Malvinas],FK,-51.796253,-59.523613
|
71 |
+
Micronesia,FM,7.425554,150.550812
|
72 |
+
Faroe Islands,FO,61.892635,-6.911806
|
73 |
+
France,FR,46.227638,2.213749
|
74 |
+
Gabon,GA,-0.803689,11.609444
|
75 |
+
United Kingdom,GB,55.378051,-3.435973
|
76 |
+
Grenada,GD,12.262776,-61.604171
|
77 |
+
Georgia,GE,42.315407,43.356892
|
78 |
+
French Guiana,GF,3.933889,-53.125782
|
79 |
+
Guernsey,GG,49.465691,-2.585278
|
80 |
+
Ghana,GH,7.946527,-1.023194
|
81 |
+
Gibraltar,GI,36.137741,-5.345374
|
82 |
+
Greenland,GL,71.706936,-42.604303
|
83 |
+
Gambia,GM,13.443182,-15.310139
|
84 |
+
Guinea,GN,9.945587,-9.696645
|
85 |
+
Guadeloupe,GP,16.995971,-62.067641
|
86 |
+
Equatorial Guinea,GQ,1.650801,10.267895
|
87 |
+
Greece,GR,39.074208,21.824312
|
88 |
+
South Georgia and the South Sandwich Islands,GS,-54.429579,-36.587909
|
89 |
+
Guatemala,GT,15.783471,-90.230759
|
90 |
+
Guam,GU,13.444304,144.793731
|
91 |
+
Guinea-Bissau,GW,11.803749,-15.180413
|
92 |
+
Guyana,GY,4.860416,-58.93018
|
93 |
+
Gaza Strip,GZ,31.354676,34.308825
|
94 |
+
Hong Kong,HK,22.396428,114.109497
|
95 |
+
Heard Island and McDonald Islands,HM,-53.08181,73.504158
|
96 |
+
Honduras,HN,15.199999,-86.241905
|
97 |
+
Croatia,HR,45.1,15.2
|
98 |
+
Haiti,HT,18.971187,-72.285215
|
99 |
+
Hungary,HU,47.162494,19.503304
|
100 |
+
Indonesia,ID,-0.789275,113.921327
|
101 |
+
Ireland,IE,53.41291,-8.24389
|
102 |
+
Israel,IL,31.046051,34.851612
|
103 |
+
Isle of Man,IM,54.236107,-4.548056
|
104 |
+
India,IN,20.593684,78.96288
|
105 |
+
British Indian Ocean Territory,IO,-6.343194,71.876519
|
106 |
+
Iraq,IQ,33.223191,43.679291
|
107 |
+
Iran,IR,32.427908,53.688046
|
108 |
+
Iceland,IS,64.963051,-19.020835
|
109 |
+
Italy,IT,41.87194,12.56738
|
110 |
+
Jersey,JE,49.214439,-2.13125
|
111 |
+
Jamaica,JM,18.109581,-77.297508
|
112 |
+
Jordan,JO,30.585164,36.238414
|
113 |
+
Japan,JP,36.204824,138.252924
|
114 |
+
Kenya,KE,-0.023559,37.906193
|
115 |
+
Kyrgyzstan,KG,41.20438,74.766098
|
116 |
+
Cambodia,KH,12.565679,104.990963
|
117 |
+
Kiribati,KI,-3.370417,-168.734039
|
118 |
+
Comoros,KM,-11.875001,43.872219
|
119 |
+
Saint Kitts and Nevis,KN,17.357822,-62.782998
|
120 |
+
North Korea,KP,40.339852,127.510093
|
121 |
+
South Korea,KR,35.907757,127.766922
|
122 |
+
Kuwait,KW,29.31166,47.481766
|
123 |
+
Cayman Islands,KY,19.513469,-80.566956
|
124 |
+
Kazakhstan,KZ,48.019573,66.923684
|
125 |
+
Laos,LA,19.85627,102.495496
|
126 |
+
Lebanon,LB,33.854721,35.862285
|
127 |
+
Saint Lucia,LC,13.909444,-60.978893
|
128 |
+
Liechtenstein,LI,47.166,9.555373
|
129 |
+
Sri Lanka,LK,7.873054,80.771797
|
130 |
+
Liberia,LR,6.428055,-9.429499
|
131 |
+
Lesotho,LS,-29.609988,28.233608
|
132 |
+
Lithuania,LT,55.169438,23.881275
|
133 |
+
Luxembourg,LU,49.815273,6.129583
|
134 |
+
Latvia,LV,56.879635,24.603189
|
135 |
+
Libya,LY,26.3351,17.228331
|
136 |
+
Morocco,MA,31.791702,-7.09262
|
137 |
+
Monaco,MC,43.750298,7.412841
|
138 |
+
Moldova,MD,47.411631,28.369885
|
139 |
+
Serbia and Montenegro,ME,42.708678,19.37439
|
140 |
+
Madagascar,MG,-18.766947,46.869107
|
141 |
+
Marshall Islands,MH,7.131474,171.184478
|
142 |
+
Macedonia [FYROM],MK,41.608635,21.745275
|
143 |
+
Mali,ML,17.570692,-3.996166
|
144 |
+
Myanmar [Burma],MM,21.913965,95.956223
|
145 |
+
Mongolia,MN,46.862496,103.846656
|
146 |
+
Macau,MO,22.198745,113.543873
|
147 |
+
Northern Mariana Islands,MP,17.33083,145.38469
|
148 |
+
Martinique,MQ,14.641528,-61.024174
|
149 |
+
Mauritania,MR,21.00789,-10.940835
|
150 |
+
Montserrat,MS,16.742498,-62.187366
|
151 |
+
Malta,MT,35.937496,14.375416
|
152 |
+
Mauritius,MU,-20.348404,57.552152
|
153 |
+
Maldives,MV,3.202778,73.22068
|
154 |
+
Malawi,MW,-13.254308,34.301525
|
155 |
+
Mexico,MX,23.634501,-102.552784
|
156 |
+
Malaysia,MY,4.210484,101.975766
|
157 |
+
Mozambique,MZ,-18.665695,35.529562
|
158 |
+
Namibia,NA,-22.95764,18.49041
|
159 |
+
New Caledonia,NC,-20.904305,165.618042
|
160 |
+
Niger,NE,17.607789,8.081666
|
161 |
+
Norfolk Island,NF,-29.040835,167.954712
|
162 |
+
Nigeria,NG,9.081999,8.675277
|
163 |
+
Nicaragua,NI,12.865416,-85.207229
|
164 |
+
Netherlands,NL,52.132633,5.291266
|
165 |
+
Norway,NO,60.472024,8.468946
|
166 |
+
Nepal,NP,28.394857,84.124008
|
167 |
+
Nauru,NR,-0.522778,166.931503
|
168 |
+
Niue,NU,-19.054445,-169.867233
|
169 |
+
New Zealand,NZ,-40.900557,174.885971
|
170 |
+
Oman,OM,21.512583,55.923255
|
171 |
+
Panama,PA,8.537981,-80.782127
|
172 |
+
Peru,PE,-9.189967,-75.015152
|
173 |
+
French Polynesia,PF,-17.679742,-149.406843
|
174 |
+
Papua New Guinea,PG,-6.314993,143.95555
|
175 |
+
Philippines,PH,12.879721,121.774017
|
176 |
+
Pakistan,PK,30.375321,69.345116
|
177 |
+
Poland,PL,51.919438,19.145136
|
178 |
+
Saint Pierre and Miquelon,PM,46.941936,-56.27111
|
179 |
+
Pitcairn Islands,PN,-24.703615,-127.439308
|
180 |
+
Puerto Rico,PR,18.220833,-66.590149
|
181 |
+
Palestinian Territories,PS,31.952162,35.233154
|
182 |
+
Portugal,PT,39.399872,-8.224454
|
183 |
+
Palau,PW,7.51498,134.58252
|
184 |
+
Paraguay,PY,-23.442503,-58.443832
|
185 |
+
Qatar,QA,25.354826,51.183884
|
186 |
+
Réunion,RE,-21.115141,55.536384
|
187 |
+
Romania,RO,45.943161,24.96676
|
188 |
+
Serbia,RS,44.016521,21.005859
|
189 |
+
Russia,RU,61.52401,105.318756
|
190 |
+
Rwanda,RW,-1.940278,29.873888
|
191 |
+
Saudi Arabia,SA,23.885942,45.079162
|
192 |
+
Solomon Islands,SB,-9.64571,160.156194
|
193 |
+
Seychelles,SC,-4.679574,55.491977
|
194 |
+
Sudan,SD,12.862807,30.217636
|
195 |
+
Sweden,SE,60.128161,18.643501
|
196 |
+
Singapore,SG,1.352083,103.819836
|
197 |
+
Saint Helena,SH,-24.143474,-10.030696
|
198 |
+
Slovenia,SI,46.151241,14.995463
|
199 |
+
Svalbard and Jan Mayen,SJ,77.553604,23.670272
|
200 |
+
Slovakia,SK,48.669026,19.699024
|
201 |
+
Sierra Leone,SL,8.460555,-11.779889
|
202 |
+
San Marino,SM,43.94236,12.457777
|
203 |
+
Senegal,SN,14.497401,-14.452362
|
204 |
+
Somalia,SO,5.152149,46.199616
|
205 |
+
Suriname,SR,3.919305,-56.027783
|
206 |
+
São Tomé and Príncipe,ST,0.18636,6.613081
|
207 |
+
El Salvador,SV,13.794185,-88.89653
|
208 |
+
Syria,SY,34.802075,38.996815
|
209 |
+
Swaziland,SZ,-26.522503,31.465866
|
210 |
+
Turks and Caicos Islands,TC,21.694025,-71.797928
|
211 |
+
Chad,TD,15.454166,18.732207
|
212 |
+
French Southern Territories,TF,-49.280366,69.348557
|
213 |
+
Togo,TG,8.619543,0.824782
|
214 |
+
Thailand,TH,15.870032,100.992541
|
215 |
+
Tajikistan,TJ,38.861034,71.276093
|
216 |
+
Tokelau,TK,-8.967363,-171.855881
|
217 |
+
Timor-Leste,TL,-8.874217,125.727539
|
218 |
+
Turkmenistan,TM,38.969719,59.556278
|
219 |
+
Tunisia,TN,33.886917,9.537499
|
220 |
+
Tonga,TO,-21.178986,-175.198242
|
221 |
+
Turkey,TR,38.963745,35.243322
|
222 |
+
Trinidad and Tobago,TT,10.691803,-61.222503
|
223 |
+
Tuvalu,TV,-7.109535,177.64933
|
224 |
+
Taiwan,TW,23.69781,120.960515
|
225 |
+
Tanzania,TZ,-6.369028,34.888822
|
226 |
+
Ukraine,UA,48.379433,31.16558
|
227 |
+
Uganda,UG,1.373333,32.290275
|
228 |
+
U.S. Minor Outlying Islands,UM,,
|
229 |
+
United States,US,37.09024,-95.712891
|
230 |
+
Uruguay,UY,-32.522779,-55.765835
|
231 |
+
Uzbekistan,UZ,41.377491,64.585262
|
232 |
+
Vatican City,VA,41.902916,12.453389
|
233 |
+
Saint Vincent and the Grenadines,VC,12.984305,-61.287228
|
234 |
+
Venezuela,VE,6.42375,-66.58973
|
235 |
+
British Virgin Islands,VG,18.420695,-64.639968
|
236 |
+
U.S. Virgin Islands,VI,18.335765,-64.896335
|
237 |
+
Vietnam,VN,14.058324,108.277199
|
238 |
+
Vanuatu,VU,-15.376706,166.959158
|
239 |
+
Wallis and Futuna,WF,-13.768752,-177.156097
|
240 |
+
Samoa,WS,-13.759029,-172.104629
|
241 |
+
Kosovo,XK,42.602636,20.902977
|
242 |
+
Yemen,YE,15.552727,48.516388
|
243 |
+
Mayotte,YT,-12.8275,45.166244
|
244 |
+
South Africa,ZA,-30.559482,22.937506
|
245 |
+
Zambia,ZM,-13.133897,27.849332
|
246 |
+
Zimbabwe,ZW,-19.015438,29.154857
|
data/US-Outbound-to-World-Regions_2021.xlsx
ADDED
Binary file (308 kB). View file
|
|
data/US-Outbound-to-World-Regions_2022.xlsx
ADDED
Binary file (309 kB). View file
|
|
data/air-passengers-carried.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
data/all.csv
ADDED
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name,alpha-2,alpha-3,country-code,iso_3166-2,region,sub-region,intermediate-region,region-code,sub-region-code,intermediate-region-code
|
2 |
+
Afghanistan,AF,AFG,004,ISO 3166-2:AF,Asia,Southern Asia,"",142,034,""
|
3 |
+
Åland Islands,AX,ALA,248,ISO 3166-2:AX,Europe,Northern Europe,"",150,154,""
|
4 |
+
Albania,AL,ALB,008,ISO 3166-2:AL,Europe,Southern Europe,"",150,039,""
|
5 |
+
Algeria,DZ,DZA,012,ISO 3166-2:DZ,Africa,Northern Africa,"",002,015,""
|
6 |
+
American Samoa,AS,ASM,016,ISO 3166-2:AS,Oceania,Polynesia,"",009,061,""
|
7 |
+
Andorra,AD,AND,020,ISO 3166-2:AD,Europe,Southern Europe,"",150,039,""
|
8 |
+
Angola,AO,AGO,024,ISO 3166-2:AO,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
9 |
+
Anguilla,AI,AIA,660,ISO 3166-2:AI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
10 |
+
Antarctica,AQ,ATA,010,ISO 3166-2:AQ,"","","","","",""
|
11 |
+
Antigua and Barbuda,AG,ATG,028,ISO 3166-2:AG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
12 |
+
Argentina,AR,ARG,032,ISO 3166-2:AR,Americas,Latin America and the Caribbean,South America,019,419,005
|
13 |
+
Armenia,AM,ARM,051,ISO 3166-2:AM,Asia,Western Asia,"",142,145,""
|
14 |
+
Aruba,AW,ABW,533,ISO 3166-2:AW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
15 |
+
Australia,AU,AUS,036,ISO 3166-2:AU,Oceania,Australia and New Zealand,"",009,053,""
|
16 |
+
Austria,AT,AUT,040,ISO 3166-2:AT,Europe,Western Europe,"",150,155,""
|
17 |
+
Azerbaijan,AZ,AZE,031,ISO 3166-2:AZ,Asia,Western Asia,"",142,145,""
|
18 |
+
Bahamas,BS,BHS,044,ISO 3166-2:BS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
19 |
+
Bahrain,BH,BHR,048,ISO 3166-2:BH,Asia,Western Asia,"",142,145,""
|
20 |
+
Bangladesh,BD,BGD,050,ISO 3166-2:BD,Asia,Southern Asia,"",142,034,""
|
21 |
+
Barbados,BB,BRB,052,ISO 3166-2:BB,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
22 |
+
Belarus,BY,BLR,112,ISO 3166-2:BY,Europe,Eastern Europe,"",150,151,""
|
23 |
+
Belgium,BE,BEL,056,ISO 3166-2:BE,Europe,Western Europe,"",150,155,""
|
24 |
+
Belize,BZ,BLZ,084,ISO 3166-2:BZ,Americas,Latin America and the Caribbean,Central America,019,419,013
|
25 |
+
Benin,BJ,BEN,204,ISO 3166-2:BJ,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
26 |
+
Bermuda,BM,BMU,060,ISO 3166-2:BM,Americas,Northern America,"",019,021,""
|
27 |
+
Bhutan,BT,BTN,064,ISO 3166-2:BT,Asia,Southern Asia,"",142,034,""
|
28 |
+
Bolivia (Plurinational State of),BO,BOL,068,ISO 3166-2:BO,Americas,Latin America and the Caribbean,South America,019,419,005
|
29 |
+
"Bonaire, Sint Eustatius and Saba",BQ,BES,535,ISO 3166-2:BQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
30 |
+
Bosnia and Herzegovina,BA,BIH,070,ISO 3166-2:BA,Europe,Southern Europe,"",150,039,""
|
31 |
+
Botswana,BW,BWA,072,ISO 3166-2:BW,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
32 |
+
Bouvet Island,BV,BVT,074,ISO 3166-2:BV,Americas,Latin America and the Caribbean,South America,019,419,005
|
33 |
+
Brazil,BR,BRA,076,ISO 3166-2:BR,Americas,Latin America and the Caribbean,South America,019,419,005
|
34 |
+
British Indian Ocean Territory,IO,IOT,086,ISO 3166-2:IO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
35 |
+
Brunei Darussalam,BN,BRN,096,ISO 3166-2:BN,Asia,South-eastern Asia,"",142,035,""
|
36 |
+
Bulgaria,BG,BGR,100,ISO 3166-2:BG,Europe,Eastern Europe,"",150,151,""
|
37 |
+
Burkina Faso,BF,BFA,854,ISO 3166-2:BF,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
38 |
+
Burundi,BI,BDI,108,ISO 3166-2:BI,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
39 |
+
Cabo Verde,CV,CPV,132,ISO 3166-2:CV,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
40 |
+
Cambodia,KH,KHM,116,ISO 3166-2:KH,Asia,South-eastern Asia,"",142,035,""
|
41 |
+
Cameroon,CM,CMR,120,ISO 3166-2:CM,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
42 |
+
Canada,CA,CAN,124,ISO 3166-2:CA,Americas,Northern America,"",019,021,""
|
43 |
+
Cayman Islands,KY,CYM,136,ISO 3166-2:KY,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
44 |
+
Central African Republic,CF,CAF,140,ISO 3166-2:CF,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
45 |
+
Chad,TD,TCD,148,ISO 3166-2:TD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
46 |
+
Chile,CL,CHL,152,ISO 3166-2:CL,Americas,Latin America and the Caribbean,South America,019,419,005
|
47 |
+
China,CN,CHN,156,ISO 3166-2:CN,Asia,Eastern Asia,"",142,030,""
|
48 |
+
Christmas Island,CX,CXR,162,ISO 3166-2:CX,Oceania,Australia and New Zealand,"",009,053,""
|
49 |
+
Cocos (Keeling) Islands,CC,CCK,166,ISO 3166-2:CC,Oceania,Australia and New Zealand,"",009,053,""
|
50 |
+
Colombia,CO,COL,170,ISO 3166-2:CO,Americas,Latin America and the Caribbean,South America,019,419,005
|
51 |
+
Comoros,KM,COM,174,ISO 3166-2:KM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
52 |
+
Congo,CG,COG,178,ISO 3166-2:CG,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
53 |
+
"Congo, Democratic Republic of the",CD,COD,180,ISO 3166-2:CD,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
54 |
+
Cook Islands,CK,COK,184,ISO 3166-2:CK,Oceania,Polynesia,"",009,061,""
|
55 |
+
Costa Rica,CR,CRI,188,ISO 3166-2:CR,Americas,Latin America and the Caribbean,Central America,019,419,013
|
56 |
+
Côte d'Ivoire,CI,CIV,384,ISO 3166-2:CI,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
57 |
+
Croatia,HR,HRV,191,ISO 3166-2:HR,Europe,Southern Europe,"",150,039,""
|
58 |
+
Cuba,CU,CUB,192,ISO 3166-2:CU,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
59 |
+
Curaçao,CW,CUW,531,ISO 3166-2:CW,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
60 |
+
Cyprus,CY,CYP,196,ISO 3166-2:CY,Asia,Western Asia,"",142,145,""
|
61 |
+
Czechia,CZ,CZE,203,ISO 3166-2:CZ,Europe,Eastern Europe,"",150,151,""
|
62 |
+
Denmark,DK,DNK,208,ISO 3166-2:DK,Europe,Northern Europe,"",150,154,""
|
63 |
+
Djibouti,DJ,DJI,262,ISO 3166-2:DJ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
64 |
+
Dominica,DM,DMA,212,ISO 3166-2:DM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
65 |
+
Dominican Republic,DO,DOM,214,ISO 3166-2:DO,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
66 |
+
Ecuador,EC,ECU,218,ISO 3166-2:EC,Americas,Latin America and the Caribbean,South America,019,419,005
|
67 |
+
Egypt,EG,EGY,818,ISO 3166-2:EG,Africa,Northern Africa,"",002,015,""
|
68 |
+
El Salvador,SV,SLV,222,ISO 3166-2:SV,Americas,Latin America and the Caribbean,Central America,019,419,013
|
69 |
+
Equatorial Guinea,GQ,GNQ,226,ISO 3166-2:GQ,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
70 |
+
Eritrea,ER,ERI,232,ISO 3166-2:ER,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
71 |
+
Estonia,EE,EST,233,ISO 3166-2:EE,Europe,Northern Europe,"",150,154,""
|
72 |
+
Eswatini,SZ,SWZ,748,ISO 3166-2:SZ,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
73 |
+
Ethiopia,ET,ETH,231,ISO 3166-2:ET,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
74 |
+
Falkland Islands (Malvinas),FK,FLK,238,ISO 3166-2:FK,Americas,Latin America and the Caribbean,South America,019,419,005
|
75 |
+
Faroe Islands,FO,FRO,234,ISO 3166-2:FO,Europe,Northern Europe,"",150,154,""
|
76 |
+
Fiji,FJ,FJI,242,ISO 3166-2:FJ,Oceania,Melanesia,"",009,054,""
|
77 |
+
Finland,FI,FIN,246,ISO 3166-2:FI,Europe,Northern Europe,"",150,154,""
|
78 |
+
France,FR,FRA,250,ISO 3166-2:FR,Europe,Western Europe,"",150,155,""
|
79 |
+
French Guiana,GF,GUF,254,ISO 3166-2:GF,Americas,Latin America and the Caribbean,South America,019,419,005
|
80 |
+
French Polynesia,PF,PYF,258,ISO 3166-2:PF,Oceania,Polynesia,"",009,061,""
|
81 |
+
French Southern Territories,TF,ATF,260,ISO 3166-2:TF,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
82 |
+
Gabon,GA,GAB,266,ISO 3166-2:GA,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
83 |
+
Gambia,GM,GMB,270,ISO 3166-2:GM,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
84 |
+
Georgia,GE,GEO,268,ISO 3166-2:GE,Asia,Western Asia,"",142,145,""
|
85 |
+
Germany,DE,DEU,276,ISO 3166-2:DE,Europe,Western Europe,"",150,155,""
|
86 |
+
Ghana,GH,GHA,288,ISO 3166-2:GH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
87 |
+
Gibraltar,GI,GIB,292,ISO 3166-2:GI,Europe,Southern Europe,"",150,039,""
|
88 |
+
Greece,GR,GRC,300,ISO 3166-2:GR,Europe,Southern Europe,"",150,039,""
|
89 |
+
Greenland,GL,GRL,304,ISO 3166-2:GL,Americas,Northern America,"",019,021,""
|
90 |
+
Grenada,GD,GRD,308,ISO 3166-2:GD,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
91 |
+
Guadeloupe,GP,GLP,312,ISO 3166-2:GP,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
92 |
+
Guam,GU,GUM,316,ISO 3166-2:GU,Oceania,Micronesia,"",009,057,""
|
93 |
+
Guatemala,GT,GTM,320,ISO 3166-2:GT,Americas,Latin America and the Caribbean,Central America,019,419,013
|
94 |
+
Guernsey,GG,GGY,831,ISO 3166-2:GG,Europe,Northern Europe,Channel Islands,150,154,830
|
95 |
+
Guinea,GN,GIN,324,ISO 3166-2:GN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
96 |
+
Guinea-Bissau,GW,GNB,624,ISO 3166-2:GW,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
97 |
+
Guyana,GY,GUY,328,ISO 3166-2:GY,Americas,Latin America and the Caribbean,South America,019,419,005
|
98 |
+
Haiti,HT,HTI,332,ISO 3166-2:HT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
99 |
+
Heard Island and McDonald Islands,HM,HMD,334,ISO 3166-2:HM,Oceania,Australia and New Zealand,"",009,053,""
|
100 |
+
Holy See,VA,VAT,336,ISO 3166-2:VA,Europe,Southern Europe,"",150,039,""
|
101 |
+
Honduras,HN,HND,340,ISO 3166-2:HN,Americas,Latin America and the Caribbean,Central America,019,419,013
|
102 |
+
Hong Kong,HK,HKG,344,ISO 3166-2:HK,Asia,Eastern Asia,"",142,030,""
|
103 |
+
Hungary,HU,HUN,348,ISO 3166-2:HU,Europe,Eastern Europe,"",150,151,""
|
104 |
+
Iceland,IS,ISL,352,ISO 3166-2:IS,Europe,Northern Europe,"",150,154,""
|
105 |
+
India,IN,IND,356,ISO 3166-2:IN,Asia,Southern Asia,"",142,034,""
|
106 |
+
Indonesia,ID,IDN,360,ISO 3166-2:ID,Asia,South-eastern Asia,"",142,035,""
|
107 |
+
Iran (Islamic Republic of),IR,IRN,364,ISO 3166-2:IR,Asia,Southern Asia,"",142,034,""
|
108 |
+
Iraq,IQ,IRQ,368,ISO 3166-2:IQ,Asia,Western Asia,"",142,145,""
|
109 |
+
Ireland,IE,IRL,372,ISO 3166-2:IE,Europe,Northern Europe,"",150,154,""
|
110 |
+
Isle of Man,IM,IMN,833,ISO 3166-2:IM,Europe,Northern Europe,"",150,154,""
|
111 |
+
Israel,IL,ISR,376,ISO 3166-2:IL,Asia,Western Asia,"",142,145,""
|
112 |
+
Italy,IT,ITA,380,ISO 3166-2:IT,Europe,Southern Europe,"",150,039,""
|
113 |
+
Jamaica,JM,JAM,388,ISO 3166-2:JM,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
114 |
+
Japan,JP,JPN,392,ISO 3166-2:JP,Asia,Eastern Asia,"",142,030,""
|
115 |
+
Jersey,JE,JEY,832,ISO 3166-2:JE,Europe,Northern Europe,Channel Islands,150,154,830
|
116 |
+
Jordan,JO,JOR,400,ISO 3166-2:JO,Asia,Western Asia,"",142,145,""
|
117 |
+
Kazakhstan,KZ,KAZ,398,ISO 3166-2:KZ,Asia,Central Asia,"",142,143,""
|
118 |
+
Kenya,KE,KEN,404,ISO 3166-2:KE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
119 |
+
Kiribati,KI,KIR,296,ISO 3166-2:KI,Oceania,Micronesia,"",009,057,""
|
120 |
+
Korea (Democratic People's Republic of),KP,PRK,408,ISO 3166-2:KP,Asia,Eastern Asia,"",142,030,""
|
121 |
+
"Korea, Republic of",KR,KOR,410,ISO 3166-2:KR,Asia,Eastern Asia,"",142,030,""
|
122 |
+
Kuwait,KW,KWT,414,ISO 3166-2:KW,Asia,Western Asia,"",142,145,""
|
123 |
+
Kyrgyzstan,KG,KGZ,417,ISO 3166-2:KG,Asia,Central Asia,"",142,143,""
|
124 |
+
Lao People's Democratic Republic,LA,LAO,418,ISO 3166-2:LA,Asia,South-eastern Asia,"",142,035,""
|
125 |
+
Latvia,LV,LVA,428,ISO 3166-2:LV,Europe,Northern Europe,"",150,154,""
|
126 |
+
Lebanon,LB,LBN,422,ISO 3166-2:LB,Asia,Western Asia,"",142,145,""
|
127 |
+
Lesotho,LS,LSO,426,ISO 3166-2:LS,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
128 |
+
Liberia,LR,LBR,430,ISO 3166-2:LR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
129 |
+
Libya,LY,LBY,434,ISO 3166-2:LY,Africa,Northern Africa,"",002,015,""
|
130 |
+
Liechtenstein,LI,LIE,438,ISO 3166-2:LI,Europe,Western Europe,"",150,155,""
|
131 |
+
Lithuania,LT,LTU,440,ISO 3166-2:LT,Europe,Northern Europe,"",150,154,""
|
132 |
+
Luxembourg,LU,LUX,442,ISO 3166-2:LU,Europe,Western Europe,"",150,155,""
|
133 |
+
Macao,MO,MAC,446,ISO 3166-2:MO,Asia,Eastern Asia,"",142,030,""
|
134 |
+
Madagascar,MG,MDG,450,ISO 3166-2:MG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
135 |
+
Malawi,MW,MWI,454,ISO 3166-2:MW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
136 |
+
Malaysia,MY,MYS,458,ISO 3166-2:MY,Asia,South-eastern Asia,"",142,035,""
|
137 |
+
Maldives,MV,MDV,462,ISO 3166-2:MV,Asia,Southern Asia,"",142,034,""
|
138 |
+
Mali,ML,MLI,466,ISO 3166-2:ML,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
139 |
+
Malta,MT,MLT,470,ISO 3166-2:MT,Europe,Southern Europe,"",150,039,""
|
140 |
+
Marshall Islands,MH,MHL,584,ISO 3166-2:MH,Oceania,Micronesia,"",009,057,""
|
141 |
+
Martinique,MQ,MTQ,474,ISO 3166-2:MQ,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
142 |
+
Mauritania,MR,MRT,478,ISO 3166-2:MR,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
143 |
+
Mauritius,MU,MUS,480,ISO 3166-2:MU,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
144 |
+
Mayotte,YT,MYT,175,ISO 3166-2:YT,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
145 |
+
Mexico,MX,MEX,484,ISO 3166-2:MX,Americas,Latin America and the Caribbean,Central America,019,419,013
|
146 |
+
Micronesia (Federated States of),FM,FSM,583,ISO 3166-2:FM,Oceania,Micronesia,"",009,057,""
|
147 |
+
"Moldova, Republic of",MD,MDA,498,ISO 3166-2:MD,Europe,Eastern Europe,"",150,151,""
|
148 |
+
Monaco,MC,MCO,492,ISO 3166-2:MC,Europe,Western Europe,"",150,155,""
|
149 |
+
Mongolia,MN,MNG,496,ISO 3166-2:MN,Asia,Eastern Asia,"",142,030,""
|
150 |
+
Montenegro,ME,MNE,499,ISO 3166-2:ME,Europe,Southern Europe,"",150,039,""
|
151 |
+
Montserrat,MS,MSR,500,ISO 3166-2:MS,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
152 |
+
Morocco,MA,MAR,504,ISO 3166-2:MA,Africa,Northern Africa,"",002,015,""
|
153 |
+
Mozambique,MZ,MOZ,508,ISO 3166-2:MZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
154 |
+
Myanmar,MM,MMR,104,ISO 3166-2:MM,Asia,South-eastern Asia,"",142,035,""
|
155 |
+
Namibia,NA,NAM,516,ISO 3166-2:NA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
156 |
+
Nauru,NR,NRU,520,ISO 3166-2:NR,Oceania,Micronesia,"",009,057,""
|
157 |
+
Nepal,NP,NPL,524,ISO 3166-2:NP,Asia,Southern Asia,"",142,034,""
|
158 |
+
Netherlands,NL,NLD,528,ISO 3166-2:NL,Europe,Western Europe,"",150,155,""
|
159 |
+
New Caledonia,NC,NCL,540,ISO 3166-2:NC,Oceania,Melanesia,"",009,054,""
|
160 |
+
New Zealand,NZ,NZL,554,ISO 3166-2:NZ,Oceania,Australia and New Zealand,"",009,053,""
|
161 |
+
Nicaragua,NI,NIC,558,ISO 3166-2:NI,Americas,Latin America and the Caribbean,Central America,019,419,013
|
162 |
+
Niger,NE,NER,562,ISO 3166-2:NE,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
163 |
+
Nigeria,NG,NGA,566,ISO 3166-2:NG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
164 |
+
Niue,NU,NIU,570,ISO 3166-2:NU,Oceania,Polynesia,"",009,061,""
|
165 |
+
Norfolk Island,NF,NFK,574,ISO 3166-2:NF,Oceania,Australia and New Zealand,"",009,053,""
|
166 |
+
North Macedonia,MK,MKD,807,ISO 3166-2:MK,Europe,Southern Europe,"",150,039,""
|
167 |
+
Northern Mariana Islands,MP,MNP,580,ISO 3166-2:MP,Oceania,Micronesia,"",009,057,""
|
168 |
+
Norway,NO,NOR,578,ISO 3166-2:NO,Europe,Northern Europe,"",150,154,""
|
169 |
+
Oman,OM,OMN,512,ISO 3166-2:OM,Asia,Western Asia,"",142,145,""
|
170 |
+
Pakistan,PK,PAK,586,ISO 3166-2:PK,Asia,Southern Asia,"",142,034,""
|
171 |
+
Palau,PW,PLW,585,ISO 3166-2:PW,Oceania,Micronesia,"",009,057,""
|
172 |
+
"Palestine, State of",PS,PSE,275,ISO 3166-2:PS,Asia,Western Asia,"",142,145,""
|
173 |
+
Panama,PA,PAN,591,ISO 3166-2:PA,Americas,Latin America and the Caribbean,Central America,019,419,013
|
174 |
+
Papua New Guinea,PG,PNG,598,ISO 3166-2:PG,Oceania,Melanesia,"",009,054,""
|
175 |
+
Paraguay,PY,PRY,600,ISO 3166-2:PY,Americas,Latin America and the Caribbean,South America,019,419,005
|
176 |
+
Peru,PE,PER,604,ISO 3166-2:PE,Americas,Latin America and the Caribbean,South America,019,419,005
|
177 |
+
Philippines,PH,PHL,608,ISO 3166-2:PH,Asia,South-eastern Asia,"",142,035,""
|
178 |
+
Pitcairn,PN,PCN,612,ISO 3166-2:PN,Oceania,Polynesia,"",009,061,""
|
179 |
+
Poland,PL,POL,616,ISO 3166-2:PL,Europe,Eastern Europe,"",150,151,""
|
180 |
+
Portugal,PT,PRT,620,ISO 3166-2:PT,Europe,Southern Europe,"",150,039,""
|
181 |
+
Puerto Rico,PR,PRI,630,ISO 3166-2:PR,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
182 |
+
Qatar,QA,QAT,634,ISO 3166-2:QA,Asia,Western Asia,"",142,145,""
|
183 |
+
Réunion,RE,REU,638,ISO 3166-2:RE,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
184 |
+
Romania,RO,ROU,642,ISO 3166-2:RO,Europe,Eastern Europe,"",150,151,""
|
185 |
+
Russian Federation,RU,RUS,643,ISO 3166-2:RU,Europe,Eastern Europe,"",150,151,""
|
186 |
+
Rwanda,RW,RWA,646,ISO 3166-2:RW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
187 |
+
Saint Barthélemy,BL,BLM,652,ISO 3166-2:BL,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
188 |
+
"Saint Helena, Ascension and Tristan da Cunha",SH,SHN,654,ISO 3166-2:SH,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
189 |
+
Saint Kitts and Nevis,KN,KNA,659,ISO 3166-2:KN,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
190 |
+
Saint Lucia,LC,LCA,662,ISO 3166-2:LC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
191 |
+
Saint Martin (French part),MF,MAF,663,ISO 3166-2:MF,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
192 |
+
Saint Pierre and Miquelon,PM,SPM,666,ISO 3166-2:PM,Americas,Northern America,"",019,021,""
|
193 |
+
Saint Vincent and the Grenadines,VC,VCT,670,ISO 3166-2:VC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
194 |
+
Samoa,WS,WSM,882,ISO 3166-2:WS,Oceania,Polynesia,"",009,061,""
|
195 |
+
San Marino,SM,SMR,674,ISO 3166-2:SM,Europe,Southern Europe,"",150,039,""
|
196 |
+
Sao Tome and Principe,ST,STP,678,ISO 3166-2:ST,Africa,Sub-Saharan Africa,Middle Africa,002,202,017
|
197 |
+
Saudi Arabia,SA,SAU,682,ISO 3166-2:SA,Asia,Western Asia,"",142,145,""
|
198 |
+
Senegal,SN,SEN,686,ISO 3166-2:SN,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
199 |
+
Serbia,RS,SRB,688,ISO 3166-2:RS,Europe,Southern Europe,"",150,039,""
|
200 |
+
Seychelles,SC,SYC,690,ISO 3166-2:SC,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
201 |
+
Sierra Leone,SL,SLE,694,ISO 3166-2:SL,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
202 |
+
Singapore,SG,SGP,702,ISO 3166-2:SG,Asia,South-eastern Asia,"",142,035,""
|
203 |
+
Sint Maarten (Dutch part),SX,SXM,534,ISO 3166-2:SX,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
204 |
+
Slovakia,SK,SVK,703,ISO 3166-2:SK,Europe,Eastern Europe,"",150,151,""
|
205 |
+
Slovenia,SI,SVN,705,ISO 3166-2:SI,Europe,Southern Europe,"",150,039,""
|
206 |
+
Solomon Islands,SB,SLB,090,ISO 3166-2:SB,Oceania,Melanesia,"",009,054,""
|
207 |
+
Somalia,SO,SOM,706,ISO 3166-2:SO,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
208 |
+
South Africa,ZA,ZAF,710,ISO 3166-2:ZA,Africa,Sub-Saharan Africa,Southern Africa,002,202,018
|
209 |
+
South Georgia and the South Sandwich Islands,GS,SGS,239,ISO 3166-2:GS,Americas,Latin America and the Caribbean,South America,019,419,005
|
210 |
+
South Sudan,SS,SSD,728,ISO 3166-2:SS,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
211 |
+
Spain,ES,ESP,724,ISO 3166-2:ES,Europe,Southern Europe,"",150,039,""
|
212 |
+
Sri Lanka,LK,LKA,144,ISO 3166-2:LK,Asia,Southern Asia,"",142,034,""
|
213 |
+
Sudan,SD,SDN,729,ISO 3166-2:SD,Africa,Northern Africa,"",002,015,""
|
214 |
+
Suriname,SR,SUR,740,ISO 3166-2:SR,Americas,Latin America and the Caribbean,South America,019,419,005
|
215 |
+
Svalbard and Jan Mayen,SJ,SJM,744,ISO 3166-2:SJ,Europe,Northern Europe,"",150,154,""
|
216 |
+
Sweden,SE,SWE,752,ISO 3166-2:SE,Europe,Northern Europe,"",150,154,""
|
217 |
+
Switzerland,CH,CHE,756,ISO 3166-2:CH,Europe,Western Europe,"",150,155,""
|
218 |
+
Syrian Arab Republic,SY,SYR,760,ISO 3166-2:SY,Asia,Western Asia,"",142,145,""
|
219 |
+
"Taiwan, Province of China",TW,TWN,158,ISO 3166-2:TW,Asia,Eastern Asia,"",142,030,""
|
220 |
+
Tajikistan,TJ,TJK,762,ISO 3166-2:TJ,Asia,Central Asia,"",142,143,""
|
221 |
+
"Tanzania, United Republic of",TZ,TZA,834,ISO 3166-2:TZ,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
222 |
+
Thailand,TH,THA,764,ISO 3166-2:TH,Asia,South-eastern Asia,"",142,035,""
|
223 |
+
Timor-Leste,TL,TLS,626,ISO 3166-2:TL,Asia,South-eastern Asia,"",142,035,""
|
224 |
+
Togo,TG,TGO,768,ISO 3166-2:TG,Africa,Sub-Saharan Africa,Western Africa,002,202,011
|
225 |
+
Tokelau,TK,TKL,772,ISO 3166-2:TK,Oceania,Polynesia,"",009,061,""
|
226 |
+
Tonga,TO,TON,776,ISO 3166-2:TO,Oceania,Polynesia,"",009,061,""
|
227 |
+
Trinidad and Tobago,TT,TTO,780,ISO 3166-2:TT,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
228 |
+
Tunisia,TN,TUN,788,ISO 3166-2:TN,Africa,Northern Africa,"",002,015,""
|
229 |
+
Turkey,TR,TUR,792,ISO 3166-2:TR,Asia,Western Asia,"",142,145,""
|
230 |
+
Turkmenistan,TM,TKM,795,ISO 3166-2:TM,Asia,Central Asia,"",142,143,""
|
231 |
+
Turks and Caicos Islands,TC,TCA,796,ISO 3166-2:TC,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
232 |
+
Tuvalu,TV,TUV,798,ISO 3166-2:TV,Oceania,Polynesia,"",009,061,""
|
233 |
+
Uganda,UG,UGA,800,ISO 3166-2:UG,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
234 |
+
Ukraine,UA,UKR,804,ISO 3166-2:UA,Europe,Eastern Europe,"",150,151,""
|
235 |
+
United Arab Emirates,AE,ARE,784,ISO 3166-2:AE,Asia,Western Asia,"",142,145,""
|
236 |
+
United Kingdom of Great Britain and Northern Ireland,GB,GBR,826,ISO 3166-2:GB,Europe,Northern Europe,"",150,154,""
|
237 |
+
United States of America,US,USA,840,ISO 3166-2:US,Americas,Northern America,"",019,021,""
|
238 |
+
United States Minor Outlying Islands,UM,UMI,581,ISO 3166-2:UM,Oceania,Micronesia,"",009,057,""
|
239 |
+
Uruguay,UY,URY,858,ISO 3166-2:UY,Americas,Latin America and the Caribbean,South America,019,419,005
|
240 |
+
Uzbekistan,UZ,UZB,860,ISO 3166-2:UZ,Asia,Central Asia,"",142,143,""
|
241 |
+
Vanuatu,VU,VUT,548,ISO 3166-2:VU,Oceania,Melanesia,"",009,054,""
|
242 |
+
Venezuela (Bolivarian Republic of),VE,VEN,862,ISO 3166-2:VE,Americas,Latin America and the Caribbean,South America,019,419,005
|
243 |
+
Viet Nam,VN,VNM,704,ISO 3166-2:VN,Asia,South-eastern Asia,"",142,035,""
|
244 |
+
Virgin Islands (British),VG,VGB,092,ISO 3166-2:VG,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
245 |
+
Virgin Islands (U.S.),VI,VIR,850,ISO 3166-2:VI,Americas,Latin America and the Caribbean,Caribbean,019,419,029
|
246 |
+
Wallis and Futuna,WF,WLF,876,ISO 3166-2:WF,Oceania,Polynesia,"",009,061,""
|
247 |
+
Western Sahara,EH,ESH,732,ISO 3166-2:EH,Africa,Northern Africa,"",002,015,""
|
248 |
+
Yemen,YE,YEM,887,ISO 3166-2:YE,Asia,Western Asia,"",142,145,""
|
249 |
+
Zambia,ZM,ZMB,894,ISO 3166-2:ZM,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
250 |
+
Zimbabwe,ZW,ZWE,716,ISO 3166-2:ZW,Africa,Sub-Saharan Africa,Eastern Africa,002,202,014
|
data/hotel_booking_2019_2020.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
data/international-travel-covid.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
data/tsa.xlsx
ADDED
Binary file (27.5 kB). View file
|
|
data/unwto-tourism-industries-data.xlsx
ADDED
Binary file (308 kB). View file
|
|
pages/Lodging.py
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
import altair as alt
|
5 |
+
from vega_datasets import data
|
6 |
+
st.set_page_config(layout="wide")
|
7 |
+
st.markdown('# Lodging')
|
8 |
+
st.markdown("""
|
9 |
+
A look into the amount of hotels/number of beds available in countries before and after the pandemic to determine how limited the lodging
|
10 |
+
capacities are in a certain country.
|
11 |
+
""")
|
12 |
+
|
13 |
+
df = pd.read_excel('./data/unwto-tourism-industries-data.xlsx', usecols = 'A,B,E:AE')
|
14 |
+
df_coords = pd.read_csv('./data/GoogleDevCountryGeoCoords.csv')
|
15 |
+
df.rename(columns={'Basic data and indicators':'Country','Unnamed: 1':'Statistics'}, inplace=True)
|
16 |
+
|
17 |
+
alt.data_transformers.disable_max_rows()
|
18 |
+
|
19 |
+
#%%
|
20 |
+
for i in range(0, len(df)-1, 8):
|
21 |
+
for j in range(1,8):
|
22 |
+
df.loc[i+j,'Country'] = df.loc[i,'Country']
|
23 |
+
|
24 |
+
df['Country'] = df['Country'].str.title()
|
25 |
+
df['Country_key'] = df['Country'].str.lower()
|
26 |
+
df_coords['Country_key2'] = df_coords['name'].str.lower()
|
27 |
+
|
28 |
+
df_merged = df.merge(right = df_coords, how='left', left_on = 'Country_key', right_on = 'Country_key2')
|
29 |
+
df_merged.tail(20)
|
30 |
+
|
31 |
+
#%%
|
32 |
+
df_merged['Country'] = df_merged['name'] #Change country names to appropriate format
|
33 |
+
df_merged.drop(columns=['Country_key','Country_key2','country','name'], inplace=True)
|
34 |
+
|
35 |
+
df_bed_places_coords = df_merged[df_merged['Statistics'] == 'Number of bed-places'].copy()
|
36 |
+
df_bed_places = df_merged[df_merged['Statistics'] == 'Number of bed-places'].copy()
|
37 |
+
|
38 |
+
df_bed_places.drop(columns=['latitude','longitude'], inplace=True)
|
39 |
+
df_bed_places.drop(columns='Statistics', inplace=True)
|
40 |
+
df_bed_places.dropna(inplace=True)
|
41 |
+
df_bed_places = pd.melt(df_bed_places.loc[:,:], id_vars='Country', var_name='Year',value_name='Number of bed-places')
|
42 |
+
# df_bed_places['Number of bed-places'] = df_bed_places['Number of bed-places'].replace('..', '0')
|
43 |
+
|
44 |
+
df_bed_places_coords = df_merged[df_merged['Statistics'] == 'Number of bed-places']
|
45 |
+
df_bed_places_coords.drop(columns='Statistics', inplace=True)
|
46 |
+
df_bed_places_coords = pd.melt(df_bed_places_coords.loc[:,:], id_vars=['Country','latitude','longitude'], var_name='Year',value_name='Number of bed-places')
|
47 |
+
df_bed_places_coords.dropna(inplace=True)
|
48 |
+
df_bed_places_coords['dataAvailable'] = (df_bed_places_coords['Number of bed-places'] != '..')
|
49 |
+
|
50 |
+
#%%
|
51 |
+
|
52 |
+
countries = list(df_bed_places['Country'].unique())
|
53 |
+
|
54 |
+
country_checkbox = alt.binding_select(options=countries)
|
55 |
+
country_selector = alt.selection_single(
|
56 |
+
fields=['Country'],
|
57 |
+
init = {'Country':countries[1]},
|
58 |
+
bind = country_checkbox,
|
59 |
+
name='Country'
|
60 |
+
)
|
61 |
+
|
62 |
+
mouseSelection = alt.selection_single(encodings = ['x'], nearest=True, on='mouseover', empty='none')
|
63 |
+
opacityCondition = alt.condition(mouseSelection, alt.value(1), alt.value(0))
|
64 |
+
|
65 |
+
click_selector = alt.selection_multi(fields=['Country'])
|
66 |
+
# click_selector = alt.selection_interval()
|
67 |
+
|
68 |
+
bedPlaceChart = alt.Chart(df_bed_places).mark_line().encode(
|
69 |
+
x = alt.X('Year:O'),
|
70 |
+
y = alt.Y('Number of bed-places:Q'),
|
71 |
+
color = alt.Color('Country:N'),
|
72 |
+
).transform_filter(
|
73 |
+
country_selector | click_selector
|
74 |
+
).add_selection(
|
75 |
+
country_selector,
|
76 |
+
click_selector
|
77 |
+
).properties(
|
78 |
+
width=600,
|
79 |
+
height=400
|
80 |
+
)
|
81 |
+
|
82 |
+
interactionDots = alt.Chart(df_bed_places).mark_point(size=90).encode(
|
83 |
+
x = alt.X('Year:O'),
|
84 |
+
y = alt.Y('Number of bed-places:Q'),
|
85 |
+
color = alt.Color('Country:N'),
|
86 |
+
opacity = opacityCondition
|
87 |
+
).transform_filter(
|
88 |
+
country_selector | click_selector
|
89 |
+
)
|
90 |
+
|
91 |
+
verticalLine = alt.Chart(df_bed_places).mark_rule(size=2, color='black', strokeDash=[15,15]).encode(
|
92 |
+
x = alt.X('Year:O'),
|
93 |
+
y = alt.Y('Number of bed-places:Q'),
|
94 |
+
opacity=opacityCondition
|
95 |
+
).transform_filter(
|
96 |
+
country_selector | click_selector
|
97 |
+
).add_selection(
|
98 |
+
mouseSelection
|
99 |
+
)
|
100 |
+
|
101 |
+
textLabels = interactionDots.mark_text(
|
102 |
+
align='left',
|
103 |
+
fontSize=14,
|
104 |
+
dx = 7,
|
105 |
+
).encode(
|
106 |
+
alt.Text('Number of bed-places:Q', formatType='number'),
|
107 |
+
opacity = opacityCondition
|
108 |
+
)
|
109 |
+
|
110 |
+
countries_url = data.world_110m.url
|
111 |
+
countries = alt.topo_feature(countries_url, 'countries')
|
112 |
+
|
113 |
+
slider = alt.binding_range(min=1995, max=2021, step=1, name='Year: ')
|
114 |
+
year_selector = alt.selection_single(
|
115 |
+
name='year selector',
|
116 |
+
fields=['Year'],
|
117 |
+
bind=slider,
|
118 |
+
init={'Year': 2021}
|
119 |
+
)
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
worldMap = alt.Chart(countries).mark_geoshape(
|
124 |
+
fill = '#F2F3F4',
|
125 |
+
stroke = 'white',
|
126 |
+
strokeWidth = 0.5
|
127 |
+
).properties(
|
128 |
+
width = 900,
|
129 |
+
height = 500,
|
130 |
+
).project(
|
131 |
+
'naturalEarth1'
|
132 |
+
)
|
133 |
+
|
134 |
+
circles = alt.Chart(df_bed_places_coords).mark_circle(size=100).encode(
|
135 |
+
latitude='latitude:Q',
|
136 |
+
longitude='longitude:Q',
|
137 |
+
tooltip=['Country:N','Year:O','Number of bed-places:Q'],
|
138 |
+
color='Number of bed-places:Q',
|
139 |
+
opacity=alt.condition(click_selector, alt.value(1), alt.value(0.4)),
|
140 |
+
size=alt.condition(click_selector, alt.value(200), alt.value(100))
|
141 |
+
).transform_filter(
|
142 |
+
year_selector
|
143 |
+
).add_selection(
|
144 |
+
click_selector,
|
145 |
+
year_selector
|
146 |
+
)
|
147 |
+
|
148 |
+
circlesNoData = alt.Chart(df_bed_places_coords).mark_circle(size=100).encode(
|
149 |
+
latitude='latitude:Q',
|
150 |
+
longitude='longitude:Q',
|
151 |
+
tooltip=['Country:N','Year:O','Number of bed-places:Q'],
|
152 |
+
color= alt.value('lightgray'),
|
153 |
+
opacity=alt.condition(click_selector, alt.value(1), alt.value(0.4)),
|
154 |
+
size=alt.condition(click_selector, alt.value(200), alt.value(150))
|
155 |
+
).transform_filter(
|
156 |
+
year_selector
|
157 |
+
).transform_filter(
|
158 |
+
alt.datum.dataAvailable == False
|
159 |
+
)
|
160 |
+
|
161 |
+
st.altair_chart((worldMap + circles + circlesNoData) & (bedPlaceChart + interactionDots + verticalLine + textLabels), use_container_width=True)
|
162 |
+
|
163 |
+
data = pd.read_csv('./data/hotel_booking_2019_2020.csv')
|
164 |
+
|
165 |
+
# %%
|
166 |
+
data_transform = data[['reservation_status_date','reservation_status']]
|
167 |
+
data_transform['reservation_status'] = (data['reservation_status'] == 'Canceled').astype(int)
|
168 |
+
data_transform['reservation_status_date'] = pd.to_datetime(data_transform['reservation_status_date'])
|
169 |
+
|
170 |
+
|
171 |
+
# %%
|
172 |
+
data_final = data_transform.groupby('reservation_status_date').count().reset_index()
|
173 |
+
|
174 |
+
# %%
|
175 |
+
line_chart = alt.Chart(data_final).mark_line().encode(
|
176 |
+
x=alt.X('reservation_status_date:T',title='Date'),
|
177 |
+
y=alt.Y('reservation_status:Q',title='Bookings'),
|
178 |
+
)
|
179 |
+
st.markdown("""
|
180 |
+
|
181 |
+
A look into the amount of hotel booking across time to learn about the trends of hotel business trends.
|
182 |
+
""")
|
183 |
+
line_chart
|
pages/Plane Travel.py
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import altair as alt
|
3 |
+
import matplotlib.pyplot as plt
|
4 |
+
import geopandas as gpd
|
5 |
+
from vega_datasets import data
|
6 |
+
import streamlit as st
|
7 |
+
import json
|
8 |
+
import folium
|
9 |
+
from streamlit_folium import folium_static
|
10 |
+
st.set_page_config(layout="wide")
|
11 |
+
st.markdown('# Plane Travel')
|
12 |
+
|
13 |
+
tsa_df = pd.read_excel('./data/tsa.xlsx')
|
14 |
+
tsa_df_date = tsa_df.set_index('Date')
|
15 |
+
tsa_df_year = tsa_df_date.stack().reset_index().rename(columns={'level_1':'year'})
|
16 |
+
tsa_df_stack = tsa_df_year.join(tsa_df_date)
|
17 |
+
tsa_df_stack = tsa_df_stack[['Date', 'year', 0]]
|
18 |
+
tsa_df_stack = tsa_df_stack.rename(columns={0:'data'})
|
19 |
+
|
20 |
+
line = alt.Chart(tsa_df_stack).mark_line().encode(
|
21 |
+
x = alt.X('Date'),
|
22 |
+
y = alt.Y('data', title = 'Passenger volumes'),
|
23 |
+
color = 'year:N',
|
24 |
+
strokeWidth = alt.value(1)
|
25 |
+
)
|
26 |
+
|
27 |
+
# 添加交互式选择器
|
28 |
+
selector = alt.selection_single(
|
29 |
+
on='mouseover',
|
30 |
+
nearest=True,
|
31 |
+
empty='none',
|
32 |
+
fields=['Date'],
|
33 |
+
init={'Date': '2022-01-01'}
|
34 |
+
)
|
35 |
+
|
36 |
+
# 创建一个点图层,用于显示选择器位置的信息
|
37 |
+
points = line.mark_point().encode(
|
38 |
+
opacity=alt.condition(selector, alt.value(1), alt.value(0))
|
39 |
+
).add_selection(selector)
|
40 |
+
|
41 |
+
# 创建一个文本图层,用于显示选择器位置对应的y值
|
42 |
+
text = line.mark_text(align='left', dx=5, dy=-5).encode(
|
43 |
+
text=alt.condition(selector, 'data:Q', alt.value(' '))
|
44 |
+
)
|
45 |
+
|
46 |
+
# 添加一条垂直线
|
47 |
+
vline = alt.Chart(tsa_df_stack).mark_rule(color='red').encode(
|
48 |
+
x='Date',
|
49 |
+
size=alt.value(0.1)
|
50 |
+
).transform_filter(
|
51 |
+
selector
|
52 |
+
)
|
53 |
+
|
54 |
+
# 将图表和交互式元素组合在一起
|
55 |
+
chart = alt.layer(line, points, text, vline)
|
56 |
+
|
57 |
+
# 显示图表
|
58 |
+
chart = chart.properties(
|
59 |
+
width=800,
|
60 |
+
title='The amount of passengers passing through TSA checkpoints across recent years'
|
61 |
+
)
|
62 |
+
|
63 |
+
st.altair_chart(chart, use_container_width=False)
|
64 |
+
|
65 |
+
st.markdown("""
|
66 |
+
A look into the most popular destinations by the amount of passengers on flights to specific destinations post-COVID
|
67 |
+
""")
|
68 |
+
|
69 |
+
df_2022 = pd.read_excel('./data/US-Outbound-to-World-Regions_2022.xlsx')
|
70 |
+
df_2022.columns = df_2022.iloc[2]
|
71 |
+
df_2022_select = df_2022.iloc[3:10].set_index('Regions')
|
72 |
+
df_2022_select.columns.name = None
|
73 |
+
df_2022_select = df_2022_select.iloc[:, : 12]
|
74 |
+
df_2022_final = df_2022_select.reset_index()
|
75 |
+
df_2022_stack = df_2022_final.iloc[:, 1:12].stack().reset_index().set_index('level_0').join(df_2022_final).iloc[:, 0:3].rename(columns = {'level_1':'Month', 0:'Data'})
|
76 |
+
bar_2022 = alt.Chart(df_2022_stack).mark_bar().encode(
|
77 |
+
x = alt.X('Month'),
|
78 |
+
y = alt.Y('Data'),
|
79 |
+
color = 'Regions:N',
|
80 |
+
)
|
81 |
+
bar_2022 = bar_2022.properties(title='2022 US citizens travel to international regions')
|
82 |
+
|
83 |
+
df_2021 = pd.read_excel('./data/US-Outbound-to-World-Regions_2021.xlsx')
|
84 |
+
df_2021.columns = df_2021.iloc[2]
|
85 |
+
df_2021_select = df_2021.iloc[3:10].set_index('Regions')
|
86 |
+
df_2021_select.columns.name = None
|
87 |
+
df_2021_select = df_2021_select.iloc[:, : 12]
|
88 |
+
df_2021_final = df_2021_select.reset_index()
|
89 |
+
df_2021_stack = df_2021_final.iloc[:, 1:12].stack().reset_index().set_index('level_0').join(df_2021_final).iloc[:, 0:3].rename(columns = {'level_1':'Month', 0:'Data'})
|
90 |
+
# 创建一个选择器,用于捕获用户在2022年数据的月份柱状图上的鼠标悬停操作
|
91 |
+
month_selector_2022 = alt.selection_single(fields=['Month'], empty='none', on='mouseover')
|
92 |
+
|
93 |
+
# 创建一个选择器,用于捕获用户在2021年数据的月份柱状图上的鼠标悬停操作
|
94 |
+
month_selector_2021 = alt.selection_single(fields=['Month'], empty='none', on='mouseover')
|
95 |
+
|
96 |
+
# Create the bar chart for 2022 data
|
97 |
+
bar_2022 = alt.Chart(df_2022_stack).mark_bar().encode(
|
98 |
+
x = alt.X('Month'),
|
99 |
+
y = alt.Y('Data'),
|
100 |
+
color = 'Regions:N',
|
101 |
+
).properties(title='2022 US citizens travel to international regions', width=300).add_selection(
|
102 |
+
month_selector_2022
|
103 |
+
)
|
104 |
+
|
105 |
+
pie_2022 = alt.Chart(df_2022_stack).mark_arc(innerRadius=50, outerRadius=100).encode(
|
106 |
+
theta='sum(Data)',
|
107 |
+
color='Regions:N',
|
108 |
+
tooltip='Regions'
|
109 |
+
).transform_filter(
|
110 |
+
month_selector_2022
|
111 |
+
).properties(width=300)
|
112 |
+
|
113 |
+
# Create the bar chart for 2021 data
|
114 |
+
bar_2021 = alt.Chart(df_2021_stack).mark_bar().encode(
|
115 |
+
x = alt.X('Month'),
|
116 |
+
y = alt.Y('Data'),
|
117 |
+
color = 'Regions:N',
|
118 |
+
).properties(title='2021 US citizens travel to international regions', width=300).add_selection(
|
119 |
+
month_selector_2021
|
120 |
+
)
|
121 |
+
|
122 |
+
pie_2021 = alt.Chart(df_2021_stack).mark_arc(innerRadius=50, outerRadius=100).encode(
|
123 |
+
theta='sum(Data)',
|
124 |
+
color='Regions:N',
|
125 |
+
tooltip='Regions'
|
126 |
+
).transform_filter(
|
127 |
+
month_selector_2021
|
128 |
+
).properties(width=300)
|
129 |
+
|
130 |
+
# Combine the charts
|
131 |
+
combined_charts = ((bar_2022 & pie_2022) | (bar_2021 & pie_2021)).resolve_scale(y='shared')
|
132 |
+
|
133 |
+
# Display the combined charts
|
134 |
+
combined_charts
|
135 |
+
|
136 |
+
|
137 |
+
alt.data_transformers.disable_max_rows()
|
138 |
+
|
139 |
+
# Load data
|
140 |
+
destination_df = pd.read_csv('./data/air-passengers-carried.csv')
|
141 |
+
destination_df['Entity'] = destination_df['Entity'].astype(str)
|
142 |
+
destination_df['Code'] = destination_df['Code'].astype(str)
|
143 |
+
|
144 |
+
# Load world data from GeoPandas
|
145 |
+
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
|
146 |
+
|
147 |
+
# Add a slider to select the year
|
148 |
+
selected_year = st.slider("Select Year", min_value=2018, max_value=2020, value=2018, step=1)
|
149 |
+
|
150 |
+
# Filter the data based on the selected year
|
151 |
+
destination_df_year = destination_df[destination_df['Year'] == selected_year]
|
152 |
+
|
153 |
+
# Merge the data
|
154 |
+
merged_data = world.set_index('iso_a3').join(destination_df_year.set_index('Code')).reset_index()
|
155 |
+
|
156 |
+
# Convert the merged data to a GeoJSON object
|
157 |
+
merged_data_geojson = json.loads(merged_data.to_json())
|
158 |
+
|
159 |
+
# Create a folium map
|
160 |
+
m = folium.Map(location=[0, 0], zoom_start=2)
|
161 |
+
|
162 |
+
# Define a function to determine the color based on the number of passengers carried
|
163 |
+
def get_color(feature):
|
164 |
+
passengers = feature['properties']['Air transport, passengers carried']
|
165 |
+
if passengers is None:
|
166 |
+
return '#FFFFFF'
|
167 |
+
elif passengers < 1e4:
|
168 |
+
return '#fee0b6'
|
169 |
+
elif passengers < 1e5:
|
170 |
+
return '#f1a340'
|
171 |
+
elif passengers < 1e6:
|
172 |
+
return '#d73027'
|
173 |
+
else:
|
174 |
+
return '#a50026'
|
175 |
+
|
176 |
+
# Add the choropleth layer to the folium map
|
177 |
+
folium.GeoJson(
|
178 |
+
merged_data_geojson,
|
179 |
+
style_function=lambda feature: {
|
180 |
+
'fillColor': get_color(feature),
|
181 |
+
'color': 'black',
|
182 |
+
'weight': 1,
|
183 |
+
'fillOpacity': 0.7,
|
184 |
+
},
|
185 |
+
tooltip=folium.features.GeoJsonTooltip(fields=['Entity', 'Air transport, passengers carried'],
|
186 |
+
aliases=['Country', 'Passengers Carried'])
|
187 |
+
).add_to(m)
|
188 |
+
st.markdown("""
|
189 |
+
A look into the most popular destinations by the amount of passengers on flights to specific destinations pre and during COVID
|
190 |
+
""")
|
191 |
+
# Display the folium map in Streamlit
|
192 |
+
folium_static(m)
|