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 9/15/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 9/15/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 1023 38928341 2.6
Albania 12054 2877800 418.9
Algeria 4243 43851043 9.7
Andorra 62 77265 80.2
Angola 3626 32866268 11.0
Antigua and Barbuda 585 97928 597.4
Argentina 41410 45195777 91.6
Armenia 7809 2963234 263.5
Australia 23840 25459700 93.6
Austria 25740 9006400 285.8
Azerbaijan 34590 10139175 341.2
Bahamas 1656 393248 421.1
Bahrain 1342 1701583 78.9
Bangladesh 32661 164689383 19.8
Barbados 1105 287371 384.5
Belarus 25283 9449321 267.6
Belgium 27608 11589616 238.2
Belize 1650 397621 415.0
Benin 5518 12123198 45.5
Bhutan 0 771612 0.0
Bolivia 4692 11673029 40.2
Bosnia and Herzegovina 9198 3280815 280.4
Botswana 8717 2351625 370.7
Brazil 230395 212559409 108.4
Brunei 1708 437483 390.4
Bulgaria 19674 6948445 283.1
Burkina Faso 195 20903278 0.9
Burma 36311 54409794 66.7
Burundi 1604 11890781 13.5
Cabo Verde 1310 555988 235.6
Cambodia 7933 16718971 47.4
Cameroon 1204 26545864 4.5
Canada 56511 37855702 149.3
Central African Republic 13 4829764 0.3
Chad 27 16425859 0.2
Chile 6110 19116209 32.0
China 603 1404676330 0.0
Colombia 23486 50882884 46.2
Comoros 28 869595 3.2
Congo (Brazzaville) 113 5518092 2.0
Congo (Kinshasa) 1176 89561404 1.3
Costa Rica 32887 5094114 645.6
Cote d'Ivoire 2193 26378275 8.3
Croatia 12088 4105268 294.5
Cuba 109033 11326616 962.6
Cyprus 2363 1207361 195.7
Czechia 4881 10708982 45.6
Denmark 7048 5792203 121.7
Diamond Princess 0 0 NaN
Djibouti 170 988002 17.2
Dominica 1060 71991 1472.4
Dominican Republic 3701 10847904 34.1
Ecuador 4427 17643060 25.1
Egypt 5750 102334403 5.6
El Salvador 3634 6486201 56.0
Equatorial Guinea 1315 1402985 93.7
Eritrea 21 3546427 0.6
Estonia 5518 1326539 416.0
Eswatini 1552 1160164 133.8
Ethiopia 17715 114963583 15.4
Fiji 2384 896444 265.9
Finland 6966 5540718 125.7
France 139668 65273512 214.0
Gabon 1403 2225728 63.0
Gambia 152 2416664 6.3
Georgia 33854 3989175 848.6
Germany 135503 83783945 161.7
Ghana 4438 31072945 14.3
Greece 31929 10423056 306.3
Grenada 2201 112519 1956.1
Guatemala 44438 17915567 248.0
Guinea 544 13132792 4.1
Guinea-Bissau 213 1967998 10.8
Guyana 2762 786559 351.1
Haiti 402 11402533 3.5
Holy See 0 809 0.0
Honduras 14411 9904608 145.5
Hungary 3691 9660350 38.2
Iceland 482 341250 141.2
India 489388 1380004385 35.5
Indonesia 78026 273523621 28.5
Iran 335154 83992953 399.0
Iraq 67805 40222503 168.6
Ireland 13300 4937796 269.4
Israel 119231 8655541 1377.5
Italy 71553 60461828 118.3
Jamaica 9015 2961161 304.4
Japan 147670 126476458 116.8
Jordan 12468 10203140 122.2
Kazakhstan 56103 18776707 298.8
Kenya 7945 53771300 14.8
Kiribati 0 117606 0.0
Korea, South 24529 51269183 47.8
Kosovo 11148 1810366 615.8
Kuwait 999 4270563 23.4
Kyrgyzstan 1513 6524191 23.2
Laos 2616 7275556 36.0
Latvia 5379 1886202 285.2
Lebanon 12244 6825442 179.4
Lesotho 0 2142252 0.0
Liberia 133 5057677 2.6
Libya 17166 6871287 249.8
Liechtenstein 116 38137 304.2
Lithuania 11619 2722291 426.8
Luxembourg 1092 625976 174.4
MS Zaandam 0 0 NaN
Madagascar 25 27691019 0.1
Malawi 624 19129955 3.3
Malaysia 265919 32365998 821.6
Maldives 1861 540542 344.3
Mali 107 20250834 0.5
Malta 628 441539 142.2
Marshall Islands 0 58413 0.0
Mauritania 1417 4649660 30.5
Mauritius 3106 1271767 244.2
Mexico 172442 127792286 134.9
Micronesia 0 113815 0.0
Moldova 9749 4033963 241.7
Monaco 74 39244 188.6
Mongolia 49134 3278292 1498.8
Montenegro 7799 628062 1241.8
Morocco 44023 36910558 119.3
Mozambique 2917 31255435 9.3
Namibia 1294 2540916 50.9
Nepal 16529 29136808 56.7
Netherlands 34587 17134873 201.9
New Zealand 354 4822233 7.3
Nicaragua 1290 6624554 19.5
Niger 81 24206636 0.3
Nigeria 7343 206139587 3.6
North Macedonia 7494 2083380 359.7
Norway 17636 5421242 325.3
Oman 875 5106622 17.1
Pakistan 48064 220892331 21.8
Palau 3 18008 16.7
Panama 4929 4314768 114.2
Papua New Guinea 616 8947027 6.9
Paraguay 777 7132530 10.9
Peru 13306 32971846 40.4
Philippines 279056 109581085 254.7
Poland 6187 37846605 16.3
Portugal 18855 10196707 184.9
Qatar 2144 2881060 74.4
Romania 30378 19237682 157.9
Russia 252716 145934460 173.2
Rwanda 5858 12952209 45.2
Saint Kitts and Nevis 435 53192 817.8
Saint Lucia 1760 183629 958.5
Saint Vincent and the Grenadines 211 110947 190.2
Samoa 0 196130 0.0
San Marino 71 33938 209.2
Sao Tome and Principe 266 219161 121.4
Saudi Arabia 2511 34813867 7.2
Senegal 619 16743930 3.7
Serbia 72233 8737370 826.7
Seychelles 465 98340 472.8
Sierra Leone 20 7976985 0.3
Singapore 6138 5850343 104.9
Slovakia 4856 5459643 88.9
Slovenia 11255 2078932 541.4
Solomon Islands 0 652858 0.0
Somalia 1354 15893219 8.5
South Africa 81998 59308690 138.3
South Sudan 321 11193729 2.9
Spain 60366 46754783 129.1
Sri Lanka 52293 21413250 244.2
Sudan 242 43849269 0.6
Summer Olympics 2020 54 0 inf
Suriname 5609 586634 956.1
Sweden 14853 10099270 147.1
Switzerland 35846 8654618 414.2
Syria 1929 17500657 11.0
Taiwan* 102 23816775 0.4
Tajikistan 232 9537642 2.4
Tanzania 0 59734213 0.0
Thailand 206389 69799978 295.7
Timor-Leste 1845 1318442 139.9
Togo 2532 8278737 30.6
Trinidad and Tobago 2696 1399491 192.6
Tunisia 30111 11818618 254.8
Turkey 326613 84339067 387.3
US 2104549 329466283 638.8
Uganda 1612 45741000 3.5
Ukraine 42302 43733759 96.7
United Arab Emirates 11388 9890400 115.1
United Kingdom 489899 67886004 721.6
Uruguay 2078 3473727 59.8
Uzbekistan 8889 33469199 26.6
Vanuatu 0 292680 0.0
Venezuela 14498 28435943 51.0
Vietnam 172110 97338583 176.8
West Bank and Gaza 32177 5101416 630.7
Yemen 627 29825968 2.1
Zambia 1639 18383956 8.9
Zimbabwe 2123 14862927 14.3

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
Summer Olympics 2020 54 0 inf
Grenada 2201 112519 1956.1
Mongolia 49134 3278292 1498.8
Dominica 1060 71991 1472.4
Israel 119231 8655541 1377.5
Montenegro 7799 628062 1241.8
Cuba 109033 11326616 962.6
Saint Lucia 1760 183629 958.5
Suriname 5609 586634 956.1
Georgia 33854 3989175 848.6
Serbia 72233 8737370 826.7
Malaysia 265919 32365998 821.6
Saint Kitts and Nevis 435 53192 817.8
United Kingdom 489899 67886004 721.6
Costa Rica 32887 5094114 645.6
US 2104549 329466283 638.8
West Bank and Gaza 32177 5101416 630.7
Kosovo 11148 1810366 615.8
Antigua and Barbuda 585 97928 597.4
Slovenia 11255 2078932 541.4
Seychelles 465 98340 472.8
Lithuania 11619 2722291 426.8
Bahamas 1656 393248 421.1
Albania 12054 2877800 418.9
Estonia 5518 1326539 416.0
Belize 1650 397621 415.0
Switzerland 35846 8654618 414.2
Iran 335154 83992953 399.0
Brunei 1708 437483 390.4
Turkey 326613 84339067 387.3
Barbados 1105 287371 384.5
Botswana 8717 2351625 370.7
North Macedonia 7494 2083380 359.7
Guyana 2762 786559 351.1
Maldives 1861 540542 344.3
Azerbaijan 34590 10139175 341.2
Norway 17636 5421242 325.3
Greece 31929 10423056 306.3
Jamaica 9015 2961161 304.4
Liechtenstein 116 38137 304.2
Kazakhstan 56103 18776707 298.8
Thailand 206389 69799978 295.7
Croatia 12088 4105268 294.5
Austria 25740 9006400 285.8
Latvia 5379 1886202 285.2
Bulgaria 19674 6948445 283.1
Bosnia and Herzegovina 9198 3280815 280.4
Ireland 13300 4937796 269.4
Belarus 25283 9449321 267.6
Fiji 2384 896444 265.9
Armenia 7809 2963234 263.5
Tunisia 30111 11818618 254.8
Philippines 279056 109581085 254.7
Libya 17166 6871287 249.8
Guatemala 44438 17915567 248.0
Sri Lanka 52293 21413250 244.2
Mauritius 3106 1271767 244.2
Moldova 9749 4033963 241.7
Belgium 27608 11589616 238.2
Cabo Verde 1310 555988 235.6
France 139668 65273512 214.0
San Marino 71 33938 209.2
Netherlands 34587 17134873 201.9
Cyprus 2363 1207361 195.7
Trinidad and Tobago 2696 1399491 192.6
Saint Vincent and the Grenadines 211 110947 190.2
Monaco 74 39244 188.6
Portugal 18855 10196707 184.9
Lebanon 12244 6825442 179.4
Vietnam 172110 97338583 176.8
Luxembourg 1092 625976 174.4
Russia 252716 145934460 173.2
Iraq 67805 40222503 168.6
Germany 135503 83783945 161.7
Romania 30378 19237682 157.9
Canada 56511 37855702 149.3
Sweden 14853 10099270 147.1
Honduras 14411 9904608 145.5
Malta 628 441539 142.2
Iceland 482 341250 141.2
Timor-Leste 1845 1318442 139.9
South Africa 81998 59308690 138.3
Mexico 172442 127792286 134.9
Eswatini 1552 1160164 133.8
Spain 60366 46754783 129.1
Finland 6966 5540718 125.7
Jordan 12468 10203140 122.2
Denmark 7048 5792203 121.7
Sao Tome and Principe 266 219161 121.4
Morocco 44023 36910558 119.3
Italy 71553 60461828 118.3
Japan 147670 126476458 116.8
United Arab Emirates 11388 9890400 115.1
Panama 4929 4314768 114.2
Brazil 230395 212559409 108.4
Singapore 6138 5850343 104.9
Ukraine 42302 43733759 96.7
Equatorial Guinea 1315 1402985 93.7
Australia 23840 25459700 93.6
Argentina 41410 45195777 91.6
Slovakia 4856 5459643 88.9
Andorra 62 77265 80.2
Bahrain 1342 1701583 78.9
Qatar 2144 2881060 74.4
Burma 36311 54409794 66.7
Gabon 1403 2225728 63.0
Uruguay 2078 3473727 59.8
Nepal 16529 29136808 56.7
El Salvador 3634 6486201 56.0
Venezuela 14498 28435943 51.0
Namibia 1294 2540916 50.9
Korea, South 24529 51269183 47.8
Cambodia 7933 16718971 47.4
Colombia 23486 50882884 46.2
Czechia 4881 10708982 45.6
Benin 5518 12123198 45.5
Rwanda 5858 12952209 45.2
Peru 13306 32971846 40.4
Bolivia 4692 11673029 40.2
Hungary 3691 9660350 38.2
Laos 2616 7275556 36.0
India 489388 1380004385 35.5
Dominican Republic 3701 10847904 34.1
Chile 6110 19116209 32.0
Togo 2532 8278737 30.6
Mauritania 1417 4649660 30.5
Indonesia 78026 273523621 28.5
Uzbekistan 8889 33469199 26.6
Ecuador 4427 17643060 25.1
Kuwait 999 4270563 23.4
Kyrgyzstan 1513 6524191 23.2
Pakistan 48064 220892331 21.8
Bangladesh 32661 164689383 19.8
Nicaragua 1290 6624554 19.5
Djibouti 170 988002 17.2
Oman 875 5106622 17.1
Palau 3 18008 16.7
Poland 6187 37846605 16.3
Ethiopia 17715 114963583 15.4
Kenya 7945 53771300 14.8
Zimbabwe 2123 14862927 14.3
Ghana 4438 31072945 14.3
Burundi 1604 11890781 13.5
Syria 1929 17500657 11.0
Angola 3626 32866268 11.0
Paraguay 777 7132530 10.9
Guinea-Bissau 213 1967998 10.8
Algeria 4243 43851043 9.7
Mozambique 2917 31255435 9.3
Zambia 1639 18383956 8.9
Somalia 1354 15893219 8.5
Cote d'Ivoire 2193 26378275 8.3
New Zealand 354 4822233 7.3
Saudi Arabia 2511 34813867 7.2
Papua New Guinea 616 8947027 6.9
Gambia 152 2416664 6.3
Egypt 5750 102334403 5.6
Cameroon 1204 26545864 4.5
Guinea 544 13132792 4.1
Senegal 619 16743930 3.7
Nigeria 7343 206139587 3.6
Uganda 1612 45741000 3.5
Haiti 402 11402533 3.5
Malawi 624 19129955 3.3
Comoros 28 869595 3.2
South Sudan 321 11193729 2.9
Afghanistan 1023 38928341 2.6
Liberia 133 5057677 2.6
Tajikistan 232 9537642 2.4
Yemen 627 29825968 2.1
Congo (Brazzaville) 113 5518092 2.0
Congo (Kinshasa) 1176 89561404 1.3
Burkina Faso 195 20903278 0.9
Sudan 242 43849269 0.6
Eritrea 21 3546427 0.6
Mali 107 20250834 0.5
Taiwan* 102 23816775 0.4
Central African Republic 13 4829764 0.3
Niger 81 24206636 0.3
Sierra Leone 20 7976985 0.3
Chad 27 16425859 0.2
Madagascar 25 27691019 0.1
China 603 1404676330 0.0
Holy See 0 809 0.0
Solomon Islands 0 652858 0.0
Tanzania 0 59734213 0.0
Kiribati 0 117606 0.0
Vanuatu 0 292680 0.0
Bhutan 0 771612 0.0
Marshall Islands 0 58413 0.0
Samoa 0 196130 0.0
Micronesia 0 113815 0.0
Lesotho 0 2142252 0.0
Diamond Princess 0 0 NaN
MS Zaandam 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/11/21    4080180.0
9/12/21    4087125.0
9/13/21    4093412.0
9/14/21    4102252.0
9/15/21    4115342.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/2/21         NaN
9/3/21      2899.0
9/4/21     18170.0
9/5/21     -1050.0
9/6/21      6779.0
9/7/21     19080.0
9/8/21      5110.0
9/9/21     23718.0
9/10/21     3148.0
9/11/21     8537.0
9/12/21     6945.0
9/13/21     6287.0
9/14/21     8840.0
9/15/21    13090.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]:
83783945.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]:
145.0791079364907
In [ ]: