Covid-19 - Données MONDIAL

Actualisé tout les soirs à 21h
Code - Import librairies
In [1]:
import glob, os    
from datetime import date

# Plotly offline
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)

import warnings
warnings.filterwarnings('ignore')

# Import lecture/stockage données
import numpy as np
import pandas as pd

# Visualisation
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
import plotly.graph_objs as go
import plotly.figure_factory as ff
import calmap
import folium
from IPython.core.display import display, HTML
In [2]:
# Palette
colorGrey = '#393e46'
colorRed = '#ff2e63' 
colorCyan = '#21bf73' 
colorYellow = '#fe9801'
Code - Chargement des données
In [5]:
# On charge et map l'ensemble des csv en un seul
# dfGlobalDaily = pd.concat(map(pd.read_csv, glob.glob(os.path.join('', "../COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/*.csv"))))

# dfGlobalDailyLatest = pd.read_csv("../COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed/" + str(d1) + ".csv")
dfGlobalDailyLatest = pd.read_csv("../COVID-19/csse_covid_19_data/csse_covid_19_daily_reports/03-23-2020.csv")

# Chargement des times series pour les cas confirmés
dfGlobalSeriesConfirmed = pd.read_csv("../COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv")

# Chargement des times series pour les cas décédés
dfGlobalSeriesDeaths = pd.read_csv("../COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv")

# Chargement des times series pour les cas soignés
dfGlobalSeriesRecovered = pd.read_csv("../COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Recovered.csv")

Cas Confirmé/Morts/Soignés par pays

Code
In [9]:
# Cas ACTIVE = cas confirmé - cas décédés - cas soignés
dfGlobalDailyLatest['Active'] = dfGlobalDailyLatest['Confirmed'] - dfGlobalDailyLatest['Deaths'] - dfGlobalDailyLatest['Recovered']
globalAll = dfGlobalDailyLatest.groupby(['Country_Region'])['Confirmed', 'Deaths', 'Recovered', 'Active'].sum()
In [10]:
classement = globalAll.sort_values(by='Confirmed', ascending=False)
classement = classement.reset_index(drop=False)
classement.style.background_gradient(cmap='Reds')
Out[10]:
Country_Region Confirmed Deaths Recovered Active
0 China 81496 3274 72819 5403
1 Italy 63927 6077 7432 50418
2 US 43667 552 0 43115
3 Spain 35136 2311 3355 29470
4 Germany 29056 123 453 28480
5 Iran 23049 1812 8376 12861
6 France 20123 862 2207 17054
7 Korea, South 8961 111 3166 5684
8 Switzerland 8795 120 131 8544
9 United Kingdom 6726 336 140 6250
10 Netherlands 4764 214 3 4547
11 Austria 4474 21 9 4444
12 Belgium 3743 88 401 3254
13 Norway 2621 10 6 2605
14 Canada 2088 25 0 2063
15 Portugal 2060 23 14 2023
16 Sweden 2046 25 16 2005
17 Brazil 1924 34 2 1888
18 Australia 1682 7 119 1556
19 Denmark 1572 24 24 1524
20 Turkey 1529 37 0 1492
21 Malaysia 1518 14 159 1345
22 Israel 1442 1 41 1400
23 Czechia 1236 1 7 1228
24 Japan 1128 42 235 851
25 Ireland 1125 6 5 1114
26 Ecuador 981 18 3 960
27 Luxembourg 875 8 6 861
28 Pakistan 875 6 13 856
29 Poland 749 8 13 728
30 Chile 746 2 11 733
31 Thailand 721 1 52 668
32 Cruise Ship 712 8 567 137
33 Finland 700 1 10 689
34 Greece 695 17 29 649
35 Iceland 588 1 51 536
36 Indonesia 579 49 30 500
37 Romania 576 7 73 496
38 Saudi Arabia 562 0 19 543
39 Singapore 509 2 152 355
40 Qatar 501 0 33 468
41 India 499 10 34 455
42 Philippines 462 33 18 411
43 Slovenia 442 3 0 439
44 Russia 438 1 17 420
45 South Africa 402 0 4 398
46 Peru 395 5 1 389
47 Bahrain 377 2 164 211
48 Egypt 366 19 68 279
49 Estonia 352 0 4 348
50 Mexico 316 3 4 309
51 Croatia 315 1 5 309
52 Panama 313 3 1 309
53 Colombia 277 3 3 271
54 Lebanon 267 4 8 255
55 Iraq 266 23 62 181
56 Argentina 266 4 27 235
57 Serbia 249 3 3 243
58 Dominican Republic 245 3 3 239
59 Armenia 235 0 2 233
60 Algeria 230 17 65 148
61 Bulgaria 201 3 3 195
62 United Arab Emirates 198 2 41 155
63 Taiwan* 195 2 28 165
64 Kuwait 189 0 30 159
65 San Marino 187 20 4 163
66 Slovakia 186 0 7 179
67 Latvia 180 0 1 179
68 Lithuania 179 1 1 177
69 Hungary 167 7 16 144
70 Uruguay 158 0 0 158
71 Costa Rica 158 2 2 154
72 Morocco 143 4 5 134
73 North Macedonia 136 2 1 133
74 Andorra 133 1 1 131
75 Bosnia and Herzegovina 132 1 2 129
76 Jordan 127 0 1 126
77 Vietnam 123 0 17 106
78 Cyprus 116 1 3 112
79 Moldova 109 1 2 106
80 Malta 107 0 2 105
81 Albania 104 4 2 98
82 New Zealand 102 0 0 102
83 Burkina Faso 99 4 5 90
84 Sri Lanka 97 0 2 95
85 Brunei 91 0 2 89
86 Tunisia 89 3 1 85
87 Cambodia 87 0 2 85
88 Belarus 81 0 22 59
89 Senegal 79 0 8 71
90 Venezuela 77 0 15 62
91 Ukraine 73 3 1 69
92 Azerbaijan 72 1 10 61
93 Oman 66 0 17 49
94 Kazakhstan 62 0 0 62
95 Georgia 61 0 8 53
96 Cameroon 56 0 2 54
97 Liechtenstein 51 0 0 51
98 Trinidad and Tobago 51 0 0 51
99 Uzbekistan 46 0 0 46
100 Nigeria 40 1 2 37
101 Afghanistan 40 1 1 38
102 Cuba 40 1 0 39
103 Mauritius 36 2 0 34
104 Rwanda 36 0 0 36
105 Congo (Kinshasa) 36 1 0 35
106 Bangladesh 33 3 5 25
107 Bolivia 27 0 0 27
108 Ghana 27 2 0 25
109 Honduras 27 0 0 27
110 Montenegro 27 1 0 26
111 Cote d'Ivoire 25 0 2 23
112 Monaco 23 0 1 22
113 Paraguay 22 1 0 21
114 Guatemala 20 1 0 19
115 Guyana 20 1 0 19
116 Jamaica 19 1 2 16
117 Togo 18 0 0 18
118 Barbados 17 0 0 17
119 Kyrgyzstan 16 0 0 16
120 Kenya 16 0 0 16
121 Maldives 13 0 5 8
122 Tanzania 12 0 0 12
123 Madagascar 12 0 0 12
124 Ethiopia 11 0 0 11
125 Mongolia 10 0 0 10
126 Uganda 9 0 0 9
127 Equatorial Guinea 9 0 0 9
128 Seychelles 7 0 0 7
129 Haiti 6 0 0 6
130 Benin 5 0 0 5
131 Suriname 5 0 0 5
132 Gabon 5 1 0 4
133 Congo (Brazzaville) 4 0 0 4
134 Bahamas 4 0 0 4
135 Eswatini 4 0 0 4
136 Guinea 4 0 0 4
137 Namibia 4 0 0 4
138 Fiji 3 0 0 3
139 Zambia 3 0 0 3
140 Angola 3 0 0 3
141 Antigua and Barbuda 3 0 0 3
142 Niger 3 0 0 3
143 Cabo Verde 3 0 0 3
144 Central African Republic 3 0 0 3
145 Liberia 3 0 0 3
146 Zimbabwe 3 1 0 2
147 El Salvador 3 0 0 3
148 Saint Lucia 3 0 0 3
149 Djibouti 3 0 0 3
150 Bhutan 2 0 0 2
151 Dominica 2 0 0 2
152 Mauritania 2 0 0 2
153 Gambia 2 1 0 1
154 Sudan 2 1 0 1
155 Nicaragua 2 0 0 2
156 Nepal 2 0 1 1
157 Saint Vincent and the Grenadines 1 0 0 1
158 Somalia 1 0 0 1
159 Mozambique 1 0 0 1
160 Grenada 1 0 0 1
161 Belize 1 0 0 1
162 Syria 1 0 0 1
163 Eritrea 1 0 0 1
164 Chad 1 0 0 1
165 Holy See 1 0 0 1
166 Papua New Guinea 1 0 0 1
167 Timor-Leste 1 0 0 1

Nombre de pays contaminé au virus au cours du temps

Code

Top 10 pays

In [11]:
display(HTML('<div class="flourish-embed flourish-bar-chart-race" data-src="visualisation/1619129"><script src="https://public.flourish.studio/resources/embed.js"></script></div>'))

Décédés

In [13]:
fig = px.bar(classement.sort_values('Deaths', ascending=False).head(10).sort_values('Deaths', ascending=True), 
             x="Deaths", y="Country_Region", text='Deaths', orientation='h', 
             width=800, height=500, range_x = [0, max(classement['Deaths'])+500])
fig.update_traces(marker_color=colorRed, opacity=0.6, textposition='outside')
iplot(fig)

Actifs

In [15]:
top10Active = px.bar(classement.sort_values('Active', ascending=False).head(10).sort_values('Active', ascending=True), 
             x="Active", y="Country_Region", text='Active', orientation='h', 
             width=800, height=500, range_x = [0, max(classement['Active'])+5000])
top10Active.update_traces(marker_color=colorGrey, opacity=0.6, textposition='outside')
iplot(top10Active)

Confirmés

In [17]:
top10Confirmed = px.bar(classement.sort_values('Confirmed', ascending=False).head(10).sort_values('Confirmed', ascending=True), 
             x="Confirmed", y="Country_Region", text='Confirmed', orientation='h', 
             width=800, height=500, range_x = [0, max(classement['Confirmed'])+8000])
top10Confirmed.update_traces(marker_color=colorYellow, opacity=0.6, textposition='outside')
iplot(top10Confirmed)

Soignés

In [19]:
top10Recovered = px.bar(classement.sort_values('Recovered', ascending=False).head(10).sort_values('Recovered', ascending=True), 
             x="Recovered", y="Country_Region", text='Recovered', orientation='h', 
             width=800, height=500, range_x = [0, max(classement['Recovered'])+6000])
top10Recovered.update_traces(marker_color=colorCyan, opacity=0.6, textposition='outside')
iplot(top10Recovered)

Comparatif de tout cas confondu

In [20]:
# Gestion du tableau des cas confirmés
tmpConfirmed = dfGlobalSeriesConfirmed
tmpConfirmed = tmpConfirmed.drop(columns=['Lat', 'Long'])
tmpConfirmed = tmpConfirmed.groupby(['Country/Region']).sum().reset_index()
tmpConfirmed = tmpConfirmed.drop(columns=['Country/Region'])
tmpConfirmed = tmpConfirmed.sum().reset_index()
tmpConfirmed = tmpConfirmed.rename(columns={'index': 'Date', 0: 'Confirmed'})

# Gestion du tableau des cas décédés
tmpDeaths = dfGlobalSeriesDeaths
tmpDeaths = tmpDeaths.drop(columns=['Lat', 'Long'])
tmpDeaths = tmpDeaths.groupby(['Country/Region']).sum().reset_index()
tmpDeaths = tmpDeaths.drop(columns=['Country/Region'])
tmpDeaths = tmpDeaths.sum().reset_index()
tmpDeaths = tmpDeaths.rename(columns={'index': 'Date', 0: 'Deaths'})

# Gestion du tableau des cas soignés
tmpRecovered = dfGlobalSeriesRecovered
tmpRecovered = tmpRecovered.drop(columns=['Lat', 'Long'])
tmpRecovered = tmpRecovered.groupby(['Country/Region']).sum().reset_index()
tmpRecovered = tmpRecovered.drop(columns=['Country/Region'])
tmpRecovered = tmpRecovered.sum().reset_index()
tmpRecovered = tmpRecovered.rename(columns={'index': 'Date', 0: 'Recovered'})

# On join nos trois tableaux
tmpAll = pd.merge(tmpConfirmed, tmpDeaths, on='Date').merge(tmpRecovered, on='Date')

# On ajoute notre colonne des cas encore malade
tmpAll['Active'] = tmpAll['Confirmed'] - tmpAll['Deaths'] - tmpAll['Recovered']

figAll = tmpAll.melt(id_vars="Date", 
                                 value_vars=['Confirmed', 'Deaths', 'Recovered', 'Active'],
                                value_name='Nombre de cas',
                              var_name='Type')
figFrSeriesAll = px.bar(figAll, 
             x="Date", 
             y="Nombre de cas", 
             color='Type',
             title='Mondial',
             barmode='group',
             color_discrete_sequence=[colorYellow, colorRed, colorCyan, colorGrey])
iplot(figFrSeriesAll)

Taux mortalité pour 100 cas confirmés

In [23]:
top10MortalityRate = classement

# Ajout de la nouvelle colonne tauxMortalité = (Morts/Confirmé)*100, arrondi à deux decimals
top10MortalityRate['Mortality Rate'] = round((top10MortalityRate['Deaths']/top10MortalityRate['Confirmed'])*100, 2)

# On prend que les pays qui ont plus de 100 cas confirmés
temp = top10MortalityRate[top10MortalityRate['Confirmed']>100]
temp = temp.sort_values('Mortality Rate', ascending=False)

fig = px.bar(temp.sort_values('Mortality Rate', ascending=False).head(15).sort_values('Mortality Rate', ascending=True), 
             x="Mortality Rate", y="Country_Region", text='Mortality Rate', orientation='h', 
             width=800, height=500, range_x = [0, 12])
fig.update_traces(marker_color=colorRed, opacity=0.6, textposition='outside')
iplot(fig)

Comparatif taux de létalité - France/Chine/Italie

In [24]:
fraSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'France') & (dfGlobalSeriesConfirmed['Province/State'] == 'France')]
fraSeriesConfirmed = fraSeriesConfirmed.drop(columns=['Lat', 'Long'])
fraSeriesDeaths = dfGlobalSeriesDeaths[(dfGlobalSeriesDeaths['Country/Region'] == 'France') & (dfGlobalSeriesDeaths['Province/State'] == 'France')]
fraSeriesDeaths = fraSeriesDeaths.drop(columns=['Lat', 'Long'])
fraSeriesAll = pd.concat([fraSeriesConfirmed, fraSeriesDeaths])
fraSeriesAll = fraSeriesAll.drop(columns=['Province/State', 'Country/Region'])
fraSeriesAll = fraSeriesAll.reset_index()
fraSeriesAll = fraSeriesAll.drop(columns=['index'])
fraSeriesAll = fraSeriesAll.transpose()
fraSeriesAll = fraSeriesAll.rename(columns={0: 'Confirmed', 1: 'Deaths'})
fraSeriesAll = fraSeriesAll.reset_index()
fraSeriesAll = fraSeriesAll.rename(columns={'index' : 'Date'})
fraSeriesAll['France'] = round((fraSeriesAll['Deaths']/fraSeriesAll['Confirmed']), 3)*100
#fraSeriesAll = fraSeriesAll.fillna({'Mortality Rate': 0.00})

itaSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'Italy')]
itaSeriesConfirmed = itaSeriesConfirmed.drop(columns=['Lat', 'Long'])
itaSeriesDeaths = dfGlobalSeriesDeaths[(dfGlobalSeriesDeaths['Country/Region'] == 'Italy')]
itaSeriesDeaths = itaSeriesDeaths.drop(columns=['Lat', 'Long'])
itaSeriesAll = pd.concat([itaSeriesConfirmed, itaSeriesDeaths])
itaSeriesAll = itaSeriesAll.drop(columns=['Province/State', 'Country/Region'])
itaSeriesAll = itaSeriesAll.reset_index()
itaSeriesAll = itaSeriesAll.drop(columns=['index'])
itaSeriesAll = itaSeriesAll.transpose()
itaSeriesAll = itaSeriesAll.rename(columns={0: 'Confirmed', 1: 'Deaths'})
itaSeriesAll = itaSeriesAll.reset_index()
itaSeriesAll = itaSeriesAll.rename(columns={'index' : 'Date'})
itaSeriesAll['Italie'] = round((itaSeriesAll['Deaths']/itaSeriesAll['Confirmed']), 3)*100
#itaSeriesAll = itaSeriesAll.fillna({'Mortality Rate': 0.00})


chiSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'China')]
chiSeriesConfirmed = chiSeriesConfirmed.drop(columns=['Lat', 'Long', 'Country/Region', 'Province/State'])
chiSeriesDeaths = dfGlobalSeriesDeaths[(dfGlobalSeriesDeaths['Country/Region'] == 'China')]
chiSeriesDeaths = chiSeriesDeaths.drop(columns=['Lat', 'Long', 'Country/Region', 'Province/State'])

chiSeriesConfirmed = chiSeriesConfirmed.sum().reset_index()
chiSeriesConfirmed = chiSeriesConfirmed.rename(columns={'index': 'Date', 0: 'Confirmed'})

chiSeriesDeaths = chiSeriesDeaths.sum().reset_index()
chiSeriesDeaths = chiSeriesDeaths.rename(columns={'index': 'Date', 0: 'Deaths'})

chiSeriesAll = pd.merge(chiSeriesConfirmed, chiSeriesDeaths, on='Date')
chiSeriesAll['Chine'] = round((chiSeriesAll['Deaths']/chiSeriesAll['Confirmed']), 3)*100


tempAll = pd.merge(chiSeriesAll[['Date', 'Chine']], itaSeriesAll[['Date', 'Italie']], on='Date').merge(fraSeriesAll[['Date', 'France']], on='Date')
#tempAll = tempAll.fillna(0.0)

tempAll = tempAll.melt(id_vars='Date', value_vars=['Chine', 'France', 'Italie'], 
                 var_name='Pays', value_name='Taux')
fig = px.line(tempAll, x="Date", y="Taux", color='Pays', log_y=True, 
              title='Taux de létalité', color_discrete_sequence=['#d21629', '#162cd2', '#008000'])
iplot(fig)

Comparatif taux de guerison - France/Chine/Italie

In [25]:
fraSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'France') & (dfGlobalSeriesConfirmed['Province/State'] == 'France')]
fraSeriesConfirmed = fraSeriesConfirmed.drop(columns=['Lat', 'Long'])
fraSeriesRecovered = dfGlobalSeriesRecovered[(dfGlobalSeriesRecovered['Country/Region'] == 'France') & (dfGlobalSeriesRecovered['Province/State'] == 'France')]
fraSeriesRecovered = fraSeriesRecovered.drop(columns=['Lat', 'Long'])
fraSeriesAll = pd.concat([fraSeriesConfirmed, fraSeriesRecovered])
fraSeriesAll = fraSeriesAll.drop(columns=['Province/State', 'Country/Region'])
fraSeriesAll = fraSeriesAll.reset_index()
fraSeriesAll = fraSeriesAll.drop(columns=['index'])
fraSeriesAll = fraSeriesAll.transpose()
fraSeriesAll = fraSeriesAll.rename(columns={0: 'Confirmed', 1: 'Recovered'})
fraSeriesAll = fraSeriesAll.reset_index()
fraSeriesAll = fraSeriesAll.rename(columns={'index' : 'Date'})
cmp10Fra = fraSeriesAll
fraSeriesAll['France'] = round((fraSeriesAll['Recovered']/fraSeriesAll['Confirmed']), 3)*100
#fraSeriesAll = fraSeriesAll.fillna({'Mortality Rate': 0.00})

itaSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'Italy')]
itaSeriesConfirmed = itaSeriesConfirmed.drop(columns=['Lat', 'Long'])
itaSeriesRecovered = dfGlobalSeriesRecovered[(dfGlobalSeriesRecovered['Country/Region'] == 'Italy')]
itaSeriesRecovered = itaSeriesRecovered.drop(columns=['Lat', 'Long'])
itaSeriesAll = pd.concat([itaSeriesConfirmed, itaSeriesDeaths])
itaSeriesAll = itaSeriesAll.drop(columns=['Province/State', 'Country/Region'])
itaSeriesAll = itaSeriesAll.reset_index()
itaSeriesAll = itaSeriesAll.drop(columns=['index'])
itaSeriesAll = itaSeriesAll.transpose()
itaSeriesAll = itaSeriesAll.rename(columns={0: 'Confirmed', 1: 'Recovered'})
itaSeriesAll = itaSeriesAll.reset_index()
itaSeriesAll = itaSeriesAll.rename(columns={'index' : 'Date'})
cmp10Ita = itaSeriesAll
itaSeriesAll['Italie'] = round((itaSeriesAll['Recovered']/itaSeriesAll['Confirmed']), 3)*100
#itaSeriesAll = itaSeriesAll.fillna({'Mortality Rate': 0.00})


chiSeriesConfirmed = dfGlobalSeriesConfirmed[(dfGlobalSeriesConfirmed['Country/Region'] == 'China')]
chiSeriesConfirmed = chiSeriesConfirmed.drop(columns=['Lat', 'Long', 'Country/Region', 'Province/State'])
chiSeriesRecovered = dfGlobalSeriesRecovered[(dfGlobalSeriesRecovered['Country/Region'] == 'China')]
chiSeriesRecovered = chiSeriesRecovered.drop(columns=['Lat', 'Long', 'Country/Region', 'Province/State'])

chiSeriesConfirmed = chiSeriesConfirmed.sum().reset_index()
chiSeriesConfirmed = chiSeriesConfirmed.rename(columns={'index': 'Date', 0: 'Confirmed'})

chiSeriesRecovered = chiSeriesRecovered.sum().reset_index()
chiSeriesRecovered = chiSeriesRecovered.rename(columns={'index': 'Date', 0: 'Recovered'})

chiSeriesAll = pd.merge(chiSeriesConfirmed, chiSeriesRecovered, on='Date')
cmp10Chi = chiSeriesAll
chiSeriesAll['Chine'] = round((chiSeriesAll['Recovered']/chiSeriesAll['Confirmed']), 3)*100


tempAll = pd.merge(chiSeriesAll[['Date', 'Chine']], itaSeriesAll[['Date', 'Italie']], on='Date').merge(fraSeriesAll[['Date', 'France']], on='Date')
#tempAll = tempAll.fillna(0.0)

tempAll = tempAll.melt(id_vars='Date', value_vars=['Chine', 'France', 'Italie'], 
                 var_name='Pays', value_name='Taux')
fig = px.line(tempAll, x="Date", y="Taux", color='Pays', log_y=True, 
              title='Taux de guérison', color_discrete_sequence=['#d21629', '#162cd2', '#008000'])
iplot(fig)

Courbe comparative des évolutions des cas - Chine/France/Italie

On compare les données à partir de 10 cas positifs

Cas confirmé

In [26]:
cmp10Ita = itaSeriesConfirmed
cmp10Ita = cmp10Ita.drop(columns=['Province/State', 'Country/Region'])
cmp10Ita = cmp10Ita.transpose()
cmp10Ita = cmp10Ita.rename(columns={16: 'Italie'})
cmp10Ita = cmp10Ita[(cmp10Ita['Italie'] > 9)]
cmp10Ita.index = pd.RangeIndex(len(cmp10Ita.index))

cmp10Fra = fraSeriesConfirmed
cmp10Fra = cmp10Fra.drop(columns=['Province/State', 'Country/Region'])
cmp10Fra = cmp10Fra.transpose()
cmp10Fra = cmp10Fra.rename(columns={157: 'France'})
cmp10Fra = cmp10Fra[(cmp10Fra['France'] > 9)]
cmp10Fra.index = pd.RangeIndex(len(cmp10Fra.index))

cmp10Chi = chiSeriesConfirmed

cmp10Chi = cmp10Chi.rename(columns={'Confirmed': "Chine"})
cmp10Chi = cmp10Chi[(cmp10Chi['Chine'] > 9)]
cmp10Chi.index = pd.RangeIndex(len(cmp10Chi.index))


cmp10Global = pd.concat([cmp10Chi, cmp10Fra, cmp10Ita], axis=1)
cmp10Global = cmp10Global.reset_index()
cmp10Global = cmp10Global.rename(columns={'index': "Jours"})
cmp10GlobalShifted = cmp10Global

cmp10Global = cmp10Global.melt(id_vars='Jours', value_vars=['Chine', 'France', 'Italie'], 
                 var_name='Legende', value_name='Value')

iplot(px.line(cmp10Global, x="Jours", y="Value", color='Legende', log_y=True, 
              title='Evolution de l\'épidemie à partir de 10 cas infectés' , color_discrete_sequence=[colorCyan, colorRed, colorYellow]))

Shift données France

En decalant les données de la france de 17 jours, on peut apercevoir que l'on suit exactement la même courbe de l'évolution de cas infectés de l'Italie

Si on décale aussi la courbe de l'Italie, celle-ci aussi se rapproche sensiblement de l'évolution qu'a connu la Chine

In [27]:
tmp10GlobalShifted = cmp10GlobalShifted.copy()
tmp10GlobalShifted.France = tmp10GlobalShifted.France.shift(-17)

fig10GlobalShifted = tmp10GlobalShifted.melt(id_vars='Jours', value_vars=['Chine', 'France', 'Italie'], 
                 var_name='Legende', value_name='Value')

iplot(px.line(fig10GlobalShifted, x="Jours", y="Value", color='Legende', log_y=True, 
              title='Evolution de l\'épidemie à partir de 10 cas infectés' , color_discrete_sequence=[colorCyan, colorRed, colorYellow]))
In [ ]:
 
In [ ]:
 
In [ ]: