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 5/23/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 5/23/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 706 38928341 1.8
Albania 509 2877800 17.7
Algeria 55 43851043 0.1
Andorra 855 77265 1106.6
Angola 0 32866268 0.0
Antarctica 0 0 NaN
Antigua and Barbuda 319 97928 325.7
Argentina 77476 45195777 171.4
Armenia 43 2963234 1.5
Australia 690958 25459700 2713.9
Austria 51582 9006400 572.7
Azerbaijan 82 10139175 0.8
Bahamas 555 393248 141.1
Bahrain 8109 1701583 476.6
Bangladesh 435 164689383 0.3
Barbados 5193 287371 1807.1
Belarus 536 9449321 5.7
Belgium 41326 11492641 359.6
Belize 942 397621 236.9
Benin 0 12123198 0.0
Bhutan 102 771612 13.2
Bolivia 1854 11673029 15.9
Bosnia and Herzegovina 400 3280815 12.2
Botswana 414 2351625 17.6
Brazil 229750 212559409 108.1
Brunei 3668 437483 838.4
Bulgaria 3781 6948445 54.4
Burkina Faso 0 20903278 0.0
Burma 171 54409794 0.3
Burundi 1005 11890781 8.5
Cabo Verde 97 555988 17.4
Cambodia 0 16718971 0.0
Cameroon 0 26545864 0.0
Canada 53732 38246108 140.5
Central African Republic 0 4829764 0.0
Chad 3 16425859 0.0
Chile 65987 19116209 345.2
China 83049 1411778724 5.9
Colombia 5466 50882884 10.7
Comoros 7 869595 0.8
Congo (Brazzaville) 0 5518092 0.0
Congo (Kinshasa) 610 89561404 0.7
Costa Rica 20243 5094114 397.4
Cote d'Ivoire 96 26378275 0.4
Croatia 6470 4105268 157.6
Cuba 959 11326616 8.5
Cyprus 4525 1207361 374.8
Czechia 6050 10708982 56.5
Denmark 7056 5837213 120.9
Diamond Princess 0 0 NaN
Djibouti 44 988002 4.5
Dominica 1259 71991 1748.8
Dominican Republic 1721 10847904 15.9
Ecuador 3690 17643060 20.9
Egypt 0 102334403 0.0
El Salvador 0 6486201 0.0
Equatorial Guinea 0 1402985 0.0
Eritrea 17 3546427 0.5
Estonia 2612 1326539 196.9
Eswatini 987 1160164 85.1
Ethiopia 663 114963583 0.6
Fiji 173 896444 19.3
Finland 28458 5540718 513.6
France 395520 65249843 606.2
Gabon 14 2225728 0.6
Gambia 3 2416664 0.1
Georgia 0 3989175 0.0
Germany 703097 83155031 845.5
Ghana 82 31072945 0.3
Greece 57635 10423056 553.0
Grenada 1751 112519 1556.2
Guatemala 7024 17915567 39.2
Guinea 112 13132792 0.9
Guinea-Bissau 31 1967998 1.6
Guyana 711 786559 90.4
Haiti 39 11402533 0.3
Holy See 0 809 0.0
Honduras 494 9904608 5.0
Hungary 11497 9660350 119.0
Iceland 1301 341250 381.2
India 32379 1380004385 2.3
Indonesia 4079 273523621 1.5
Iran 4562 83992953 5.4
Iraq 1647 40222503 4.1
Ireland 27280 4937796 552.5
Israel 29614 8655541 342.1
Italy 441154 60461828 729.6
Jamaica 3333 2961161 112.6
Japan 506306 126476458 400.3
Jordan 698 10203140 6.8
Kazakhstan 171 18776707 0.9
Kenya 374 53771300 0.7
Kiribati 5 117606 4.3
Korea, North 1 25778815 0.0
Korea, South 379090 51269183 739.4
Kosovo 163 1810366 9.0
Kuwait 883 4270563 20.7
Kyrgyzstan 0 6524191 0.0
Laos 985 7275556 13.5
Latvia 2566 1886202 136.0
Lebanon 1065 6825442 15.6
Lesotho 154 2142252 7.2
Liberia 21 5057677 0.4
Libya 68 6871287 1.0
Liechtenstein 126 38137 330.4
Lithuania 1952 2722291 71.7
Luxembourg 3022 625976 482.8
MS Zaandam 0 0 NaN
Madagascar 78 27691019 0.3
Malawi 124 19129955 0.6
Malaysia 31729 32365998 98.0
Maldives 179 540542 33.1
Mali 117 20250834 0.6
Malta 1160 441539 262.7
Marshall Islands 0 58413 0.0
Mauritania 290 4649660 6.2
Mauritius 1874 1271767 147.4
Mexico 14121 127792286 11.0
Micronesia 0 113815 0.0
Moldova 739 4027690 18.3
Monaco 199 39244 507.1
Mongolia 1837 3278292 56.0
Montenegro 925 628062 147.3
Morocco 1433 36910558 3.9
Mozambique 156 31255435 0.5
Namibia 5675 2540916 223.3
Nepal 128 29136808 0.4
Netherlands 18714 17134873 109.2
New Zealand 108391 4822233 2247.7
Nicaragua 0 6624554 0.0
Niger 45 24206636 0.2
Nigeria 171 206139587 0.1
North Macedonia 1052 2083380 50.5
Norway 3362 5421242 62.0
Oman 167 5106622 3.3
Pakistan 1004 220892331 0.5
Palau 235 18008 1305.0
Panama 42215 4314768 978.4
Papua New Guinea 576 8947027 6.4
Paraguay 565 7132530 7.9
Peru 6527 32971846 19.8
Philippines 1935 109581085 1.8
Poland 4996 37846605 13.2
Portugal 517362 10196707 5073.8
Qatar 1938 2881060 67.3
Romania 6722 19237682 34.9
Russia 63946 145934460 43.8
Rwanda 116 12952209 0.9
Saint Kitts and Nevis 80 53192 150.4
Saint Lucia 1276 183629 694.9
Saint Vincent and the Grenadines 141 110947 127.1
Samoa 1456 196130 742.4
San Marino 357 33938 1051.9
Sao Tome and Principe 12 219161 5.5
Saudi Arabia 7712 34813867 22.2
Senegal 59 16743930 0.4
Serbia 4887 8737370 55.9
Seychelles 888 98340 903.0
Sierra Leone 0 7976985 0.0
Singapore 52193 5850343 892.1
Slovakia 4824 5434712 88.8
Slovenia 6618 2078932 318.3
Solomon Islands 1733 652858 265.4
Somalia 36 15893219 0.2
South Africa 86909 59308690 146.5
South Sudan 68 11193729 0.6
Spain 175918 46754783 376.3
Sri Lanka 204 21413250 1.0
Sudan 80 43849269 0.2
Summer Olympics 2020 0 0 NaN
Suriname 847 586634 144.4
Sweden 3517 10099270 34.8
Switzerland 23711 8654618 274.0
Syria 22 17500657 0.1
Taiwan* 989136 23816775 4153.1
Tajikistan 0 9537642 0.0
Tanzania 1482 59734213 2.5
Thailand 82169 69799978 117.7
Timor-Leste 11 1318442 0.8
Togo 43 8278737 0.5
Tonga 735 105697 695.4
Trinidad and Tobago 6862 1399491 490.3
Tunisia 1077 11818618 9.1
Turkey 19299 84339067 22.9
US 1381031 329466283 419.2
Uganda 4 45741000 0.0
Ukraine 0 43733759 0.0
United Arab Emirates 4667 9890400 47.2
United Kingdom 130483 67886004 192.2
Uruguay 8355 3473727 240.5
Uzbekistan 204 33469199 0.6
Vanuatu 626 292680 213.9
Venezuela 628 28435943 2.2
Vietnam 31707 97338583 32.6
West Bank and Gaza 380 5101416 7.4
Winter Olympics 2022 0 0 NaN
Yemen 0 29825968 0.0
Zambia 1038 18383956 5.6
Zimbabwe 2166 14862927 14.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
Portugal 517362 10196707 5073.8
Taiwan* 989136 23816775 4153.1
Australia 690958 25459700 2713.9
New Zealand 108391 4822233 2247.7
Barbados 5193 287371 1807.1
Dominica 1259 71991 1748.8
Grenada 1751 112519 1556.2
Palau 235 18008 1305.0
Andorra 855 77265 1106.6
San Marino 357 33938 1051.9
Panama 42215 4314768 978.4
Seychelles 888 98340 903.0
Singapore 52193 5850343 892.1
Germany 703097 83155031 845.5
Brunei 3668 437483 838.4
Samoa 1456 196130 742.4
Korea, South 379090 51269183 739.4
Italy 441154 60461828 729.6
Tonga 735 105697 695.4
Saint Lucia 1276 183629 694.9
France 395520 65249843 606.2
Austria 51582 9006400 572.7
Greece 57635 10423056 553.0
Ireland 27280 4937796 552.5
Finland 28458 5540718 513.6
Monaco 199 39244 507.1
Trinidad and Tobago 6862 1399491 490.3
Luxembourg 3022 625976 482.8
Bahrain 8109 1701583 476.6
US 1381031 329466283 419.2
Japan 506306 126476458 400.3
Costa Rica 20243 5094114 397.4
Iceland 1301 341250 381.2
Spain 175918 46754783 376.3
Cyprus 4525 1207361 374.8
Belgium 41326 11492641 359.6
Chile 65987 19116209 345.2
Israel 29614 8655541 342.1
Liechtenstein 126 38137 330.4
Antigua and Barbuda 319 97928 325.7
Slovenia 6618 2078932 318.3
Switzerland 23711 8654618 274.0
Solomon Islands 1733 652858 265.4
Malta 1160 441539 262.7
Uruguay 8355 3473727 240.5
Belize 942 397621 236.9
Namibia 5675 2540916 223.3
Vanuatu 626 292680 213.9
Estonia 2612 1326539 196.9
United Kingdom 130483 67886004 192.2
Argentina 77476 45195777 171.4
Croatia 6470 4105268 157.6
Saint Kitts and Nevis 80 53192 150.4
Mauritius 1874 1271767 147.4
Montenegro 925 628062 147.3
South Africa 86909 59308690 146.5
Suriname 847 586634 144.4
Bahamas 555 393248 141.1
Canada 53732 38246108 140.5
Latvia 2566 1886202 136.0
Saint Vincent and the Grenadines 141 110947 127.1
Denmark 7056 5837213 120.9
Hungary 11497 9660350 119.0
Thailand 82169 69799978 117.7
Jamaica 3333 2961161 112.6
Netherlands 18714 17134873 109.2
Brazil 229750 212559409 108.1
Malaysia 31729 32365998 98.0
Guyana 711 786559 90.4
Slovakia 4824 5434712 88.8
Eswatini 987 1160164 85.1
Lithuania 1952 2722291 71.7
Qatar 1938 2881060 67.3
Norway 3362 5421242 62.0
Czechia 6050 10708982 56.5
Mongolia 1837 3278292 56.0
Serbia 4887 8737370 55.9
Bulgaria 3781 6948445 54.4
North Macedonia 1052 2083380 50.5
United Arab Emirates 4667 9890400 47.2
Russia 63946 145934460 43.8
Guatemala 7024 17915567 39.2
Romania 6722 19237682 34.9
Sweden 3517 10099270 34.8
Maldives 179 540542 33.1
Vietnam 31707 97338583 32.6
Turkey 19299 84339067 22.9
Saudi Arabia 7712 34813867 22.2
Ecuador 3690 17643060 20.9
Kuwait 883 4270563 20.7
Peru 6527 32971846 19.8
Fiji 173 896444 19.3
Moldova 739 4027690 18.3
Albania 509 2877800 17.7
Botswana 414 2351625 17.6
Cabo Verde 97 555988 17.4
Bolivia 1854 11673029 15.9
Dominican Republic 1721 10847904 15.9
Lebanon 1065 6825442 15.6
Zimbabwe 2166 14862927 14.6
Laos 985 7275556 13.5
Bhutan 102 771612 13.2
Poland 4996 37846605 13.2
Bosnia and Herzegovina 400 3280815 12.2
Mexico 14121 127792286 11.0
Colombia 5466 50882884 10.7
Tunisia 1077 11818618 9.1
Kosovo 163 1810366 9.0
Cuba 959 11326616 8.5
Burundi 1005 11890781 8.5
Paraguay 565 7132530 7.9
West Bank and Gaza 380 5101416 7.4
Lesotho 154 2142252 7.2
Jordan 698 10203140 6.8
Papua New Guinea 576 8947027 6.4
Mauritania 290 4649660 6.2
China 83049 1411778724 5.9
Belarus 536 9449321 5.7
Zambia 1038 18383956 5.6
Sao Tome and Principe 12 219161 5.5
Iran 4562 83992953 5.4
Honduras 494 9904608 5.0
Djibouti 44 988002 4.5
Kiribati 5 117606 4.3
Iraq 1647 40222503 4.1
Morocco 1433 36910558 3.9
Oman 167 5106622 3.3
Tanzania 1482 59734213 2.5
India 32379 1380004385 2.3
Venezuela 628 28435943 2.2
Philippines 1935 109581085 1.8
Afghanistan 706 38928341 1.8
Guinea-Bissau 31 1967998 1.6
Armenia 43 2963234 1.5
Indonesia 4079 273523621 1.5
Sri Lanka 204 21413250 1.0
Libya 68 6871287 1.0
Guinea 112 13132792 0.9
Kazakhstan 171 18776707 0.9
Rwanda 116 12952209 0.9
Comoros 7 869595 0.8
Timor-Leste 11 1318442 0.8
Azerbaijan 82 10139175 0.8
Congo (Kinshasa) 610 89561404 0.7
Kenya 374 53771300 0.7
Malawi 124 19129955 0.6
Mali 117 20250834 0.6
Uzbekistan 204 33469199 0.6
Ethiopia 663 114963583 0.6
South Sudan 68 11193729 0.6
Gabon 14 2225728 0.6
Eritrea 17 3546427 0.5
Mozambique 156 31255435 0.5
Togo 43 8278737 0.5
Pakistan 1004 220892331 0.5
Liberia 21 5057677 0.4
Cote d'Ivoire 96 26378275 0.4
Senegal 59 16743930 0.4
Nepal 128 29136808 0.4
Haiti 39 11402533 0.3
Madagascar 78 27691019 0.3
Bangladesh 435 164689383 0.3
Ghana 82 31072945 0.3
Burma 171 54409794 0.3
Somalia 36 15893219 0.2
Niger 45 24206636 0.2
Sudan 80 43849269 0.2
Syria 22 17500657 0.1
Nigeria 171 206139587 0.1
Gambia 3 2416664 0.1
Algeria 55 43851043 0.1
Nicaragua 0 6624554 0.0
Marshall Islands 0 58413 0.0
Micronesia 0 113815 0.0
Angola 0 32866268 0.0
Korea, North 1 25778815 0.0
Ukraine 0 43733759 0.0
Yemen 0 29825968 0.0
Kyrgyzstan 0 6524191 0.0
Uganda 4 45741000 0.0
Congo (Brazzaville) 0 5518092 0.0
Benin 0 12123198 0.0
Holy See 0 809 0.0
Sierra Leone 0 7976985 0.0
Burkina Faso 0 20903278 0.0
Georgia 0 3989175 0.0
Tajikistan 0 9537642 0.0
Cambodia 0 16718971 0.0
Cameroon 0 26545864 0.0
Equatorial Guinea 0 1402985 0.0
Central African Republic 0 4829764 0.0
Egypt 0 102334403 0.0
Chad 3 16425859 0.0
El Salvador 0 6486201 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]:
5/19/22    25998085.0
5/20/22    26040460.0
5/21/22    26044283.0
5/22/22    26045528.0
5/23/22    26109965.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]:
5/10/22        NaN
5/11/22    88961.0
5/12/22    68999.0
5/13/22    61859.0
5/14/22     6151.0
5/15/22     2305.0
5/16/22    86252.0
5/17/22    72051.0
5/18/22    58719.0
5/19/22    48910.0
5/20/22    42375.0
5/21/22     3823.0
5/22/22     1245.0
5/23/22    64437.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]:
728.8638976035016
In [ ]: