14-day cumulative number of COVID-19 cases per 100 000

At the end of the page, we provide a detailed description of how the numbers are calculated.

Compute data

In [1]:
import pandas as pd
pd.set_option("display.max_rows", None)
from oscovida import get_incidence_rates_countries

Table for all countries

In [2]:
cases_incidence, deaths_incidence = get_incidence_rates_countries()
Downloaded data: last data point 9/18/22 from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
Downloaded data: last data point 9/18/22 from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv
In [3]:
cases_incidence
Out[3]:
14-day-sum population 14-day-incidence-rate
Country
Afghanistan 3077 38928341 7.9
Albania 1390 2877800 48.3
Algeria 166 43851043 0.4
Andorra 120 77265 155.3
Angola 495 32866268 1.5
Antarctica 0 0 NaN
Antigua and Barbuda 34 97928 34.7
Argentina 14077 45195777 31.1
Armenia 4904 2963234 165.5
Australia 86726 25459700 340.6
Austria 58104 9006400 645.1
Azerbaijan 3995 10139175 39.4
Bahamas 106 393248 27.0
Bahrain 3647 1701583 214.3
Bangladesh 4853 164689383 2.9
Barbados 742 287371 258.2
Belarus 0 9449321 0.0
Belgium 23536 11492641 204.8
Belize 354 397621 89.0
Benin 148 12123198 1.2
Bhutan 343 771612 44.5
Bolivia 3037 11673029 26.0
Bosnia and Herzegovina 1549 3280815 47.2
Botswana 263 2351625 11.2
Brazil 112688 212559409 53.0
Brunei 4365 437483 997.8
Bulgaria 6936 6948445 99.8
Burkina Faso 0 20903278 0.0
Burma 3339 54409794 6.1
Burundi 512 11890781 4.3
Cabo Verde 26 555988 4.7
Cambodia 106 16718971 0.6
Cameroon 0 26545864 0.0
Canada 35986 38246108 94.1
Central African Republic 42 4829764 0.9
Chad 22 16425859 0.1
Chile 35933 19116209 188.0
China 141994 1411778724 10.1
Colombia 2753 50882884 5.4
Comoros 12 869595 1.4
Congo (Brazzaville) 0 5518092 0.0
Congo (Kinshasa) 40 89561404 0.0
Costa Rica 17076 5094114 335.2
Cote d'Ivoire 210 26378275 0.8
Croatia 8408 4105268 204.8
Cuba 318 11326616 2.8
Cyprus 4351 1207361 360.4
Czechia 27513 10708982 256.9
Denmark 10707 5837213 183.4
Diamond Princess 0 0 NaN
Djibouti 0 988002 0.0
Dominica 0 71991 0.0
Dominican Republic 3952 10847904 36.4
Ecuador 2990 17643060 16.9
Egypt 0 102334403 0.0
El Salvador 0 6486201 0.0
Equatorial Guinea 34 1402985 2.4
Eritrea 9 3546427 0.3
Estonia 1758 1326539 132.5
Eswatini 11 1160164 0.9
Ethiopia 193 114963583 0.2
Fiji 46 896444 5.1
Finland 10556 5540718 190.5
France 296088 65249843 453.8
Gabon 33 2225728 1.5
Gambia 197 2416664 8.2
Georgia 26524 3989175 664.9
Germany 432528 83155031 520.1
Ghana 36 31072945 0.1
Greece 75984 10423056 729.0
Grenada 127 112519 112.9
Guatemala 10042 17915567 56.1
Guinea 182 13132792 1.4
Guinea-Bissau 0 1967998 0.0
Guyana 156 786559 19.8
Haiti 170 11402533 1.5
Holy See 0 809 0.0
Honduras 1057 9904608 10.7
Hungary 21896 9660350 226.7
Iceland 567 341250 166.2
India 76601 1380004385 5.6
Indonesia 36264 273523621 13.3
Iran 9735 83992953 11.6
Iraq 638 40222503 1.6
Ireland 3679 4937796 74.5
Israel 13994 8655541 161.7
Italy 222747 60461828 368.4
Jamaica 1089 2961161 36.8
Japan 1233027 126476458 974.9
Jordan 9537 10203140 93.5
Kazakhstan 2716 18776707 14.5
Kenya 106 53771300 0.2
Kiribati 0 117606 0.0
Korea, North 0 25778815 0.0
Korea, South 807133 51269183 1574.3
Kosovo 269 1810366 14.9
Kuwait 350 4270563 8.2
Kyrgyzstan 204 6524191 3.1
Laos 1041 7275556 14.3
Latvia 12717 1886202 674.2
Lebanon 2922 6825442 42.8
Lesotho 284 2142252 13.3
Liberia 46 5057677 0.9
Libya 77 6871287 1.1
Liechtenstein 236 38137 618.8
Lithuania 14551 2722291 534.5
Luxembourg 63 625976 10.1
MS Zaandam 0 0 NaN
Madagascar 20 27691019 0.1
Malawi 79 19129955 0.4
Malaysia 27434 32365998 84.8
Maldives 110 540542 20.3
Mali 885 20250834 4.4
Malta 276 441539 62.5
Marshall Islands 150 58413 256.8
Mauritania 13 4649660 0.3
Mauritius 4495 1271767 353.4
Mexico 28583 127792286 22.4
Micronesia 2154 113815 1892.5
Moldova 8131 4027690 201.9
Monaco 97 39244 247.2
Mongolia 1978 3278292 60.3
Montenegro 2049 628062 326.2
Morocco 230 36910558 0.6
Mozambique 90 31255435 0.3
Namibia 0 2540916 0.0
Nauru 1 10834 9.2
Nepal 1373 29136808 4.7
Netherlands 15140 17134873 88.4
New Zealand 13008 4822233 269.8
Nicaragua 59 6624554 0.9
Niger 0 24206636 0.0
Nigeria 1066 206139587 0.5
North Macedonia 1380 2083380 66.2
Norway 1082 5421242 20.0
Oman 147 5106622 2.9
Pakistan 2818 220892331 1.3
Palau 42 18008 233.2
Panama 6053 4314768 140.3
Papua New Guinea 44 8947027 0.5
Paraguay 440 7132530 6.2
Peru 17570 32971846 53.3
Philippines 29275 109581085 26.7
Poland 57200 37846605 151.1
Portugal 30887 10196707 302.9
Qatar 9926 2881060 344.5
Romania 25894 19237682 134.6
Russia 701000 145934460 480.4
Rwanda 33 12952209 0.3
Saint Kitts and Nevis 24 53192 45.1
Saint Lucia 65 183629 35.4
Saint Vincent and the Grenadines 16 110947 14.4
Samoa 50 196130 25.5
San Marino 154 33938 453.8
Sao Tome and Principe 40 219161 18.3
Saudi Arabia 1431 34813867 4.1
Senegal 166 16743930 1.0
Serbia 39963 8737370 457.4
Seychelles 277 98340 281.7
Sierra Leone 3 7976985 0.0
Singapore 29181 5850343 498.8
Slovakia 35323 5434712 650.0
Slovenia 25729 2078932 1237.6
Solomon Islands 0 652858 0.0
Somalia 177 15893219 1.1
South Africa 3068 59308690 5.2
South Sudan 0 11193729 0.0
Spain 32857 46754783 70.3
Sri Lanka 420 21413250 2.0
Sudan 47 43849269 0.1
Summer Olympics 2020 0 0 NaN
Suriname 39 586634 6.6
Sweden 9369 10099270 92.8
Switzerland 28337 8654618 327.4
Syria 135 17500657 0.8
Taiwan* 527457 23816775 2214.6
Tajikistan 0 9537642 0.0
Tanzania 541 59734213 0.9
Thailand 13727 69799978 19.7
Timor-Leste 60 1318442 4.6
Togo 195 8278737 2.4
Tonga 377 105697 356.7
Trinidad and Tobago 2361 1399491 168.7
Tunisia 1301 11818618 11.0
Turkey 54632 84339067 64.8
Tuvalu 0 11792 0.0
US 909626 329466283 276.1
Uganda 0 45741000 0.0
Ukraine 48691 43733759 111.3
United Arab Emirates 5815 9890400 58.8
United Kingdom 65230 67886004 96.1
Uruguay 3686 3473727 106.1
Uzbekistan 193 33469199 0.6
Vanuatu 101 292680 34.5
Venezuela 1336 28435943 4.7
Vietnam 39555 97338583 40.6
West Bank and Gaza 436 5101416 8.5
Winter Olympics 2022 0 0 NaN
Yemen 1 29825968 0.0
Zambia 308 18383956 1.7
Zimbabwe 233 14862927 1.6

Table sorted by 14-day-incidence

In [4]:
cases_incidence.sort_values(by=['14-day-incidence-rate'], ascending=False)
Out[4]:
14-day-sum population 14-day-incidence-rate
Country
Taiwan* 527457 23816775 2214.6
Micronesia 2154 113815 1892.5
Korea, South 807133 51269183 1574.3
Slovenia 25729 2078932 1237.6
Brunei 4365 437483 997.8
Japan 1233027 126476458 974.9
Greece 75984 10423056 729.0
Latvia 12717 1886202 674.2
Georgia 26524 3989175 664.9
Slovakia 35323 5434712 650.0
Austria 58104 9006400 645.1
Liechtenstein 236 38137 618.8
Lithuania 14551 2722291 534.5
Germany 432528 83155031 520.1
Singapore 29181 5850343 498.8
Russia 701000 145934460 480.4
Serbia 39963 8737370 457.4
San Marino 154 33938 453.8
France 296088 65249843 453.8
Italy 222747 60461828 368.4
Cyprus 4351 1207361 360.4
Tonga 377 105697 356.7
Mauritius 4495 1271767 353.4
Qatar 9926 2881060 344.5
Australia 86726 25459700 340.6
Costa Rica 17076 5094114 335.2
Switzerland 28337 8654618 327.4
Montenegro 2049 628062 326.2
Portugal 30887 10196707 302.9
Seychelles 277 98340 281.7
US 909626 329466283 276.1
New Zealand 13008 4822233 269.8
Barbados 742 287371 258.2
Czechia 27513 10708982 256.9
Marshall Islands 150 58413 256.8
Monaco 97 39244 247.2
Palau 42 18008 233.2
Hungary 21896 9660350 226.7
Bahrain 3647 1701583 214.3
Croatia 8408 4105268 204.8
Belgium 23536 11492641 204.8
Moldova 8131 4027690 201.9
Finland 10556 5540718 190.5
Chile 35933 19116209 188.0
Denmark 10707 5837213 183.4
Trinidad and Tobago 2361 1399491 168.7
Iceland 567 341250 166.2
Armenia 4904 2963234 165.5
Israel 13994 8655541 161.7
Andorra 120 77265 155.3
Poland 57200 37846605 151.1
Panama 6053 4314768 140.3
Romania 25894 19237682 134.6
Estonia 1758 1326539 132.5
Grenada 127 112519 112.9
Ukraine 48691 43733759 111.3
Uruguay 3686 3473727 106.1
Bulgaria 6936 6948445 99.8
United Kingdom 65230 67886004 96.1
Canada 35986 38246108 94.1
Jordan 9537 10203140 93.5
Sweden 9369 10099270 92.8
Belize 354 397621 89.0
Netherlands 15140 17134873 88.4
Malaysia 27434 32365998 84.8
Ireland 3679 4937796 74.5
Spain 32857 46754783 70.3
North Macedonia 1380 2083380 66.2
Turkey 54632 84339067 64.8
Malta 276 441539 62.5
Mongolia 1978 3278292 60.3
United Arab Emirates 5815 9890400 58.8
Guatemala 10042 17915567 56.1
Peru 17570 32971846 53.3
Brazil 112688 212559409 53.0
Albania 1390 2877800 48.3
Bosnia and Herzegovina 1549 3280815 47.2
Saint Kitts and Nevis 24 53192 45.1
Bhutan 343 771612 44.5
Lebanon 2922 6825442 42.8
Vietnam 39555 97338583 40.6
Azerbaijan 3995 10139175 39.4
Jamaica 1089 2961161 36.8
Dominican Republic 3952 10847904 36.4
Saint Lucia 65 183629 35.4
Antigua and Barbuda 34 97928 34.7
Vanuatu 101 292680 34.5
Argentina 14077 45195777 31.1
Bahamas 106 393248 27.0
Philippines 29275 109581085 26.7
Bolivia 3037 11673029 26.0
Samoa 50 196130 25.5
Mexico 28583 127792286 22.4
Maldives 110 540542 20.3
Norway 1082 5421242 20.0
Guyana 156 786559 19.8
Thailand 13727 69799978 19.7
Sao Tome and Principe 40 219161 18.3
Ecuador 2990 17643060 16.9
Kosovo 269 1810366 14.9
Kazakhstan 2716 18776707 14.5
Saint Vincent and the Grenadines 16 110947 14.4
Laos 1041 7275556 14.3
Indonesia 36264 273523621 13.3
Lesotho 284 2142252 13.3
Iran 9735 83992953 11.6
Botswana 263 2351625 11.2
Tunisia 1301 11818618 11.0
Honduras 1057 9904608 10.7
China 141994 1411778724 10.1
Luxembourg 63 625976 10.1
Nauru 1 10834 9.2
West Bank and Gaza 436 5101416 8.5
Kuwait 350 4270563 8.2
Gambia 197 2416664 8.2
Afghanistan 3077 38928341 7.9
Suriname 39 586634 6.6
Paraguay 440 7132530 6.2
Burma 3339 54409794 6.1
India 76601 1380004385 5.6
Colombia 2753 50882884 5.4
South Africa 3068 59308690 5.2
Fiji 46 896444 5.1
Cabo Verde 26 555988 4.7
Venezuela 1336 28435943 4.7
Nepal 1373 29136808 4.7
Timor-Leste 60 1318442 4.6
Mali 885 20250834 4.4
Burundi 512 11890781 4.3
Saudi Arabia 1431 34813867 4.1
Kyrgyzstan 204 6524191 3.1
Bangladesh 4853 164689383 2.9
Oman 147 5106622 2.9
Cuba 318 11326616 2.8
Togo 195 8278737 2.4
Equatorial Guinea 34 1402985 2.4
Sri Lanka 420 21413250 2.0
Zambia 308 18383956 1.7
Zimbabwe 233 14862927 1.6
Iraq 638 40222503 1.6
Haiti 170 11402533 1.5
Gabon 33 2225728 1.5
Angola 495 32866268 1.5
Guinea 182 13132792 1.4
Comoros 12 869595 1.4
Pakistan 2818 220892331 1.3
Benin 148 12123198 1.2
Somalia 177 15893219 1.1
Libya 77 6871287 1.1
Senegal 166 16743930 1.0
Tanzania 541 59734213 0.9
Liberia 46 5057677 0.9
Nicaragua 59 6624554 0.9
Eswatini 11 1160164 0.9
Central African Republic 42 4829764 0.9
Syria 135 17500657 0.8
Cote d'Ivoire 210 26378275 0.8
Morocco 230 36910558 0.6
Uzbekistan 193 33469199 0.6
Cambodia 106 16718971 0.6
Nigeria 1066 206139587 0.5
Papua New Guinea 44 8947027 0.5
Algeria 166 43851043 0.4
Malawi 79 19129955 0.4
Mauritania 13 4649660 0.3
Eritrea 9 3546427 0.3
Rwanda 33 12952209 0.3
Mozambique 90 31255435 0.3
Kenya 106 53771300 0.2
Ethiopia 193 114963583 0.2
Ghana 36 31072945 0.1
Sudan 47 43849269 0.1
Chad 22 16425859 0.1
Madagascar 20 27691019 0.1
Kiribati 0 117606 0.0
Uganda 0 45741000 0.0
Belarus 0 9449321 0.0
Korea, North 0 25778815 0.0
Niger 0 24206636 0.0
Namibia 0 2540916 0.0
Yemen 1 29825968 0.0
Burkina Faso 0 20903278 0.0
Holy See 0 809 0.0
Congo (Kinshasa) 40 89561404 0.0
Guinea-Bissau 0 1967998 0.0
Tuvalu 0 11792 0.0
Cameroon 0 26545864 0.0
El Salvador 0 6486201 0.0
Egypt 0 102334403 0.0
Tajikistan 0 9537642 0.0
Dominica 0 71991 0.0
Djibouti 0 988002 0.0
Solomon Islands 0 652858 0.0
Congo (Brazzaville) 0 5518092 0.0
South Sudan 0 11193729 0.0
Sierra Leone 3 7976985 0.0
Antarctica 0 0 NaN
Diamond Princess 0 0 NaN
MS Zaandam 0 0 NaN
Summer Olympics 2020 0 0 NaN
Winter Olympics 2022 0 0 NaN

Tutorial: Detailed calculation for one country

In [5]:
from oscovida import fetch_cases, get_population
import datetime
In [6]:
period = 14 # Days we compute the incidence rate over
In [7]:
cases = fetch_cases() # Get a DataFrame where each row is the country, and columns cumulative case numbers
cases = cases.groupby(cases.index).sum() # Merge the rows for different regions as we want the numbers for an entire country
In [8]:
cases_germany = cases.loc['Germany'][2:] # First 2 entries are lat/lon so we only take the subsequent ones
cases_germany.tail()
Out[8]:
9/14/22    32604993.0
9/15/22    32643742.0
9/16/22    32680355.0
9/17/22    32680356.0
9/18/22    32680356.0
Name: Germany, dtype: float64
In [9]:
yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
x_days_ago = yesterday - datetime.timedelta(days=period)
In [10]:
period_mask = (
    (yesterday > pd.to_datetime(cases_germany.index)) &
    (pd.to_datetime(cases_germany.index) > x_days_ago)
) # Mask for dates between today and x days ago
In [11]:
cases_in_period_per_day_germany = cases_germany[period_mask].diff() # Apply the period mask and get the diff to get the daily new cases
cases_in_period_per_day_germany
Out[11]:
9/5/22         NaN
9/6/22     46495.0
9/7/22     42057.0
9/8/22     35995.0
9/9/22     30166.0
9/10/22        0.0
9/11/22        0.0
9/12/22    54930.0
9/13/22    51299.0
9/14/22    46514.0
9/15/22    38749.0
9/16/22    36613.0
9/17/22        1.0
9/18/22        0.0
Name: Germany, dtype: float64
In [12]:
cases_in_period_per_day_germany.plot() # We can easily look at new cases per day
Out[12]:
<AxesSubplot: >
In [13]:
population = get_population().population
In [14]:
population_germany = population.loc['Germany'] # Get the population of Germany
population_germany
Out[14]:
83155031.0
In [15]:
incidence_rate_germany = cases_in_period_per_day_germany.sum() / population_germany * 100_000
incidence_rate_germany # By convention this is total cases over period / population * 100_000
Out[15]:
460.36781586913247
In [ ]: