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 datetime as dt
import pandas as pd
pd.set_option("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 11/25/21 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 11/25/21 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 688 38928341 1.8
Albania 6852 2877800 238.1
Algeria 2000 43851043 4.6
Andorra 822 77265 1063.9
Angola 248 32866268 0.8
Antigua and Barbuda 39 97928 39.8
Argentina 19682 45195777 43.5
Armenia 10809 2963234 364.8
Australia 18228 25459700 71.6
Austria 185739 9006400 2062.3
Azerbaijan 26411 10139175 260.5
Bahamas 144 393248 36.6
Bahrain 345 1701583 20.3
Bangladesh 3279 164689383 2.0
Barbados 3121 287371 1086.1
Belarus 25054 9449321 265.1
Belgium 216313 11492641 1882.2
Belize 1311 397621 329.7
Benin 17 12123198 0.1
Bhutan 10 771612 1.3
Bolivia 12238 11673029 104.8
Bosnia and Herzegovina 9157 3280815 279.1
Botswana 1208 2351625 51.4
Brazil 130640 212559409 61.5
Brunei 713 437483 163.0
Bulgaria 34859 6948445 501.7
Burkina Faso 233 20903278 1.1
Burma 9488 54409794 17.4
Burundi 150 11890781 1.3
Cabo Verde 60 555988 10.8
Cambodia 651 16718971 3.9
Cameroon 604 26545864 2.3
Canada 37742 38246108 98.7
Central African Republic 129 4829764 2.7
Chad 0 16425859 0.0
Chile 33684 19116209 176.2
China 524 1411778724 0.0
Colombia 33634 50882884 66.1
Comoros 126 869595 14.5
Congo (Brazzaville) 684 5518092 12.4
Congo (Kinshasa) 398 89561404 0.4
Costa Rica 2505 5094114 49.2
Cote d'Ivoire 179 26378275 0.7
Croatia 67178 4105268 1636.4
Cuba 3963 11326616 35.0
Cyprus 4690 1207361 388.5
Czechia 205509 10708982 1919.0
Denmark 55139 5837213 944.6
Diamond Princess 0 0 NaN
Djibouti 10 988002 1.0
Dominica 584 71991 811.2
Dominican Republic 13290 10847904 122.5
Ecuador 4872 17643060 27.6
Egypt 12735 102334403 12.4
El Salvador 691 6486201 10.7
Equatorial Guinea 62 1402985 4.4
Eritrea 256 3546427 7.2
Estonia 10281 1326539 775.0
Eswatini 49 1160164 4.2
Ethiopia 2780 114963583 2.4
Fiji 118 896444 13.2
Finland 13759 5540718 248.3
France 260736 65249843 399.6
Gabon 636 2225728 28.6
Gambia 9 2416664 0.4
Georgia 55333 3989175 1387.1
Germany 712879 83155031 857.3
Ghana 271 31072945 0.9
Greece 93154 10423056 893.7
Grenada 17 112519 15.1
Guatemala 8247 17915567 46.0
Guinea 36 13132792 0.3
Guinea-Bissau 175 1967998 8.9
Guyana 1080 786559 137.3
Haiti 741 11402533 6.5
Holy See 0 809 0.0
Honduras 871 9904608 8.8
Hungary 125603 9660350 1300.2
Iceland 2154 341250 631.2
India 141245 1380004385 10.2
Indonesia 5057 273523621 1.8
Iran 77725 83992953 92.5
Iraq 10760 40222503 26.8
Ireland 62386 4937796 1263.4
Israel 4914 8655541 56.8
Italy 132906 60461828 219.8
Jamaica 1035 2961161 35.0
Japan 1807 126476458 1.4
Jordan 46497 10203140 455.7
Kazakhstan 15649 18776707 83.3
Kenya 711 53771300 1.3
Kiribati 0 117606 0.0
Korea, South 42182 51269183 82.3
Kosovo 138 1810366 7.6
Kuwait 288 4270563 6.7
Kyrgyzstan 976 6524191 15.0
Laos 16345 7275556 224.7
Latvia 13367 1886202 708.7
Lebanon 14083 6825442 206.3
Lesotho 48 2142252 2.2
Liberia 3 5057677 0.1
Libya 6704 6871287 97.6
Liechtenstein 591 38137 1549.7
Lithuania 25741 2722291 945.6
Luxembourg 3704 625976 591.7
MS Zaandam 0 0 NaN
Madagascar 400 27691019 1.4
Malawi 38 19129955 0.2
Malaysia 80158 32365998 247.7
Maldives 1758 540542 325.2
Mali 582 20250834 2.9
Malta 944 441539 213.8
Marshall Islands 0 58413 0.0
Mauritania 1009 4649660 21.7
Mauritius 0 1271767 0.0
Mexico 38083 127792286 29.8
Micronesia 0 113815 0.0
Moldova 10419 4033963 258.3
Monaco 202 39244 514.7
Mongolia 9806 3278292 299.1
Montenegro 5211 628062 829.7
Morocco 1476 36910558 4.0
Mozambique 102 31255435 0.3
Namibia 106 2540916 4.2
Nepal 4225 29136808 14.5
Netherlands 281787 17134873 1644.5
New Zealand 2660 4822233 55.2
Nicaragua 275 6624554 4.2
Niger 295 24206636 1.2
Nigeria 936 206139587 0.5
North Macedonia 5781 2083380 277.5
Norway 30065 5421242 554.6
Oman 109 5106622 2.1
Pakistan 4333 220892331 2.0
Palau 0 18008 0.0
Panama 2811 4314768 65.1
Papua New Guinea 2468 8947027 27.6
Paraguay 959 7132530 13.4
Peru 18375 32971846 55.7
Philippines 18370 109581085 16.8
Poland 271468 37846605 717.3
Portugal 30803 10196707 302.1
Qatar 1968 2881060 68.3
Romania 41454 19237682 215.5
Russia 499454 145934460 342.2
Rwanda 256 12952209 2.0
Saint Kitts and Nevis 39 53192 73.3
Saint Lucia 142 183629 77.3
Saint Vincent and the Grenadines 265 110947 238.9
Samoa 0 196130 0.0
San Marino 294 33938 866.3
Sao Tome and Principe 1 219161 0.5
Saudi Arabia 515 34813867 1.5
Senegal 28 16743930 0.2
Serbia 43089 8737370 493.2
Seychelles 623 98340 633.5
Sierra Leone 0 7976985 0.0
Singapore 28708 5850343 490.7
Slovakia 140908 5459643 2580.9
Slovenia 42632 2078932 2050.7
Solomon Islands 0 652858 0.0
Somalia 179 15893219 1.1
South Africa 27522 59308690 46.4
South Sudan 171 11193729 1.5
Spain 78297 46754783 167.5
Sri Lanka 12284 21413250 57.4
Sudan 963 43849269 2.2
Summer Olympics 2020 0 0 NaN
Suriname 754 586634 128.5
Sweden 15156 10099270 150.1
Switzerland 73689 8654618 851.4
Syria 1844 17500657 10.5
Taiwan* 89 23816775 0.4
Tajikistan 5 9537642 0.1
Tanzania 65 59734213 0.1
Thailand 97917 69799978 140.3
Timor-Leste 11 1318442 0.8
Togo 99 8278737 1.2
Tonga 0 105697 0.0
Trinidad and Tobago 7304 1399491 521.9
Tunisia 1372 11818618 11.6
Turkey 336317 84339067 398.8
US 1259855 329466283 382.4
Uganda 574 45741000 1.3
Ukraine 245148 43733759 560.5
United Arab Emirates 991 9890400 10.0
United Kingdom 580721 67886004 855.4
Uruguay 2712 3473727 78.1
Uzbekistan 3283 33469199 9.8
Vanuatu 0 292680 0.0
Venezuela 12263 28435943 43.1
Vietnam 167331 97338583 171.9
West Bank and Gaza 2806 5101416 55.0
Yemen 70 29825968 0.2
Zambia 159 18383956 0.9
Zimbabwe 445 14862927 3.0

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
Slovakia 140908 5459643 2580.9
Austria 185739 9006400 2062.3
Slovenia 42632 2078932 2050.7
Czechia 205509 10708982 1919.0
Belgium 216313 11492641 1882.2
Netherlands 281787 17134873 1644.5
Croatia 67178 4105268 1636.4
Liechtenstein 591 38137 1549.7
Georgia 55333 3989175 1387.1
Hungary 125603 9660350 1300.2
Ireland 62386 4937796 1263.4
Barbados 3121 287371 1086.1
Andorra 822 77265 1063.9
Lithuania 25741 2722291 945.6
Denmark 55139 5837213 944.6
Greece 93154 10423056 893.7
San Marino 294 33938 866.3
Germany 712879 83155031 857.3
United Kingdom 580721 67886004 855.4
Switzerland 73689 8654618 851.4
Montenegro 5211 628062 829.7
Dominica 584 71991 811.2
Estonia 10281 1326539 775.0
Poland 271468 37846605 717.3
Latvia 13367 1886202 708.7
Seychelles 623 98340 633.5
Iceland 2154 341250 631.2
Luxembourg 3704 625976 591.7
Ukraine 245148 43733759 560.5
Norway 30065 5421242 554.6
Trinidad and Tobago 7304 1399491 521.9
Monaco 202 39244 514.7
Bulgaria 34859 6948445 501.7
Serbia 43089 8737370 493.2
Singapore 28708 5850343 490.7
Jordan 46497 10203140 455.7
France 260736 65249843 399.6
Turkey 336317 84339067 398.8
Cyprus 4690 1207361 388.5
US 1259855 329466283 382.4
Armenia 10809 2963234 364.8
Russia 499454 145934460 342.2
Belize 1311 397621 329.7
Maldives 1758 540542 325.2
Portugal 30803 10196707 302.1
Mongolia 9806 3278292 299.1
Bosnia and Herzegovina 9157 3280815 279.1
North Macedonia 5781 2083380 277.5
Belarus 25054 9449321 265.1
Azerbaijan 26411 10139175 260.5
Moldova 10419 4033963 258.3
Finland 13759 5540718 248.3
Malaysia 80158 32365998 247.7
Saint Vincent and the Grenadines 265 110947 238.9
Albania 6852 2877800 238.1
Laos 16345 7275556 224.7
Italy 132906 60461828 219.8
Romania 41454 19237682 215.5
Malta 944 441539 213.8
Lebanon 14083 6825442 206.3
Chile 33684 19116209 176.2
Vietnam 167331 97338583 171.9
Spain 78297 46754783 167.5
Brunei 713 437483 163.0
Sweden 15156 10099270 150.1
Thailand 97917 69799978 140.3
Guyana 1080 786559 137.3
Suriname 754 586634 128.5
Dominican Republic 13290 10847904 122.5
Bolivia 12238 11673029 104.8
Canada 37742 38246108 98.7
Libya 6704 6871287 97.6
Iran 77725 83992953 92.5
Kazakhstan 15649 18776707 83.3
Korea, South 42182 51269183 82.3
Uruguay 2712 3473727 78.1
Saint Lucia 142 183629 77.3
Saint Kitts and Nevis 39 53192 73.3
Australia 18228 25459700 71.6
Qatar 1968 2881060 68.3
Colombia 33634 50882884 66.1
Panama 2811 4314768 65.1
Brazil 130640 212559409 61.5
Sri Lanka 12284 21413250 57.4
Israel 4914 8655541 56.8
Peru 18375 32971846 55.7
New Zealand 2660 4822233 55.2
West Bank and Gaza 2806 5101416 55.0
Botswana 1208 2351625 51.4
Costa Rica 2505 5094114 49.2
South Africa 27522 59308690 46.4
Guatemala 8247 17915567 46.0
Argentina 19682 45195777 43.5
Venezuela 12263 28435943 43.1
Antigua and Barbuda 39 97928 39.8
Bahamas 144 393248 36.6
Cuba 3963 11326616 35.0
Jamaica 1035 2961161 35.0
Mexico 38083 127792286 29.8
Gabon 636 2225728 28.6
Ecuador 4872 17643060 27.6
Papua New Guinea 2468 8947027 27.6
Iraq 10760 40222503 26.8
Mauritania 1009 4649660 21.7
Bahrain 345 1701583 20.3
Burma 9488 54409794 17.4
Philippines 18370 109581085 16.8
Grenada 17 112519 15.1
Kyrgyzstan 976 6524191 15.0
Nepal 4225 29136808 14.5
Comoros 126 869595 14.5
Paraguay 959 7132530 13.4
Fiji 118 896444 13.2
Egypt 12735 102334403 12.4
Congo (Brazzaville) 684 5518092 12.4
Tunisia 1372 11818618 11.6
Cabo Verde 60 555988 10.8
El Salvador 691 6486201 10.7
Syria 1844 17500657 10.5
India 141245 1380004385 10.2
United Arab Emirates 991 9890400 10.0
Uzbekistan 3283 33469199 9.8
Guinea-Bissau 175 1967998 8.9
Honduras 871 9904608 8.8
Kosovo 138 1810366 7.6
Eritrea 256 3546427 7.2
Kuwait 288 4270563 6.7
Haiti 741 11402533 6.5
Algeria 2000 43851043 4.6
Equatorial Guinea 62 1402985 4.4
Nicaragua 275 6624554 4.2
Eswatini 49 1160164 4.2
Namibia 106 2540916 4.2
Morocco 1476 36910558 4.0
Cambodia 651 16718971 3.9
Zimbabwe 445 14862927 3.0
Mali 582 20250834 2.9
Central African Republic 129 4829764 2.7
Ethiopia 2780 114963583 2.4
Cameroon 604 26545864 2.3
Sudan 963 43849269 2.2
Lesotho 48 2142252 2.2
Oman 109 5106622 2.1
Bangladesh 3279 164689383 2.0
Rwanda 256 12952209 2.0
Pakistan 4333 220892331 2.0
Indonesia 5057 273523621 1.8
Afghanistan 688 38928341 1.8
Saudi Arabia 515 34813867 1.5
South Sudan 171 11193729 1.5
Madagascar 400 27691019 1.4
Japan 1807 126476458 1.4
Bhutan 10 771612 1.3
Kenya 711 53771300 1.3
Burundi 150 11890781 1.3
Uganda 574 45741000 1.3
Togo 99 8278737 1.2
Niger 295 24206636 1.2
Somalia 179 15893219 1.1
Burkina Faso 233 20903278 1.1
Djibouti 10 988002 1.0
Ghana 271 31072945 0.9
Zambia 159 18383956 0.9
Angola 248 32866268 0.8
Timor-Leste 11 1318442 0.8
Cote d'Ivoire 179 26378275 0.7
Sao Tome and Principe 1 219161 0.5
Nigeria 936 206139587 0.5
Gambia 9 2416664 0.4
Congo (Kinshasa) 398 89561404 0.4
Taiwan* 89 23816775 0.4
Guinea 36 13132792 0.3
Mozambique 102 31255435 0.3
Yemen 70 29825968 0.2
Senegal 28 16743930 0.2
Malawi 38 19129955 0.2
Benin 17 12123198 0.1
Tajikistan 5 9537642 0.1
Tanzania 65 59734213 0.1
Liberia 3 5057677 0.1
China 524 1411778724 0.0
Chad 0 16425859 0.0
Tonga 0 105697 0.0
Micronesia 0 113815 0.0
Mauritius 0 1271767 0.0
Holy See 0 809 0.0
Marshall Islands 0 58413 0.0
Vanuatu 0 292680 0.0
Solomon Islands 0 652858 0.0
Kiribati 0 117606 0.0
Samoa 0 196130 0.0
Sierra Leone 0 7976985 0.0
Palau 0 18008 0.0
Diamond Princess 0 0 NaN
MS Zaandam 0 0 NaN
Summer Olympics 2020 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]:
11/21/21    5400687.0
11/22/21    5448574.0
11/23/21    5516623.0
11/24/21    5595674.0
11/25/21    5670253.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]:
11/12/21        NaN
11/13/21    34309.0
11/14/21    19203.0
11/15/21    34958.0
11/16/21    53627.0
11/17/21    68366.0
11/18/21    58768.0
11/19/21    57302.0
11/20/21    45183.0
11/21/21    26241.0
11/22/21    47887.0
11/23/21    68049.0
11/24/21    79051.0
11/25/21    74579.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]:
802.7451760555533
In [ ]: