At the end of the page, we provide a detailed description of how the numbers are calculated.
import datetime as dt
import pandas as pd
pd.set_option("max_rows", None)
from oscovida import get_incidence_rates_countries
cases_incidence, deaths_incidence = get_incidence_rates_countries()
Downloaded data: last data point 1/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 1/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
cases_incidence
14-day-sum | population | 14-day-incidence-rate | |
---|---|---|---|
Country | |||
Afghanistan | 2305 | 38928341 | 5.9 |
Albania | 7644 | 2877800 | 265.6 |
Algeria | 3222 | 43851043 | 7.3 |
Andorra | 780 | 77265 | 1009.5 |
Angola | 1071 | 32866268 | 3.3 |
Antigua and Barbuda | 25 | 97928 | 25.5 |
Argentina | 148213 | 45195777 | 327.9 |
Armenia | 4174 | 2963234 | 140.9 |
Australia | 205 | 25459700 | 0.8 |
Austria | 26486 | 9006400 | 294.1 |
Azerbaijan | 7087 | 10139175 | 69.9 |
Bahamas | 134 | 393248 | 34.1 |
Bahrain | 3836 | 1701583 | 225.4 |
Bangladesh | 11301 | 164689383 | 6.9 |
Barbados | 641 | 287371 | 223.1 |
Belarus | 23479 | 9449321 | 248.5 |
Belgium | 25920 | 11589616 | 223.6 |
Belize | 722 | 397621 | 181.6 |
Benin | 162 | 12123198 | 1.3 |
Bhutan | 127 | 771612 | 16.5 |
Bolivia | 21534 | 11673029 | 184.5 |
Bosnia and Herzegovina | 4868 | 3280815 | 148.4 |
Botswana | 2560 | 2351625 | 108.9 |
Brazil | 677087 | 212559409 | 318.5 |
Brunei | 17 | 437483 | 3.9 |
Bulgaria | 8623 | 6948445 | 124.1 |
Burkina Faso | 1942 | 20903278 | 9.3 |
Burma | 7762 | 54409794 | 14.3 |
Burundi | 328 | 11890781 | 2.8 |
Cabo Verde | 893 | 555988 | 160.6 |
Cambodia | 55 | 16718971 | 0.3 |
Cameroon | 488 | 26545864 | 1.8 |
Canada | 110603 | 37855702 | 292.2 |
Central African Republic | 10 | 4829764 | 0.2 |
Chad | 638 | 16425859 | 3.9 |
Chile | 45278 | 19116209 | 236.9 |
China | 1530 | 1404676330 | 0.1 |
Colombia | 203771 | 50882884 | 400.5 |
Comoros | 605 | 869595 | 69.6 |
Congo (Brazzaville) | 602 | 5518092 | 10.9 |
Congo (Kinshasa) | 2558 | 89561404 | 2.9 |
Costa Rica | 14866 | 5094114 | 291.8 |
Cote d'Ivoire | 2293 | 26378275 | 8.7 |
Croatia | 11550 | 4105268 | 281.3 |
Cuba | 4871 | 11326616 | 43.0 |
Cyprus | 5164 | 1207361 | 427.7 |
Czechia | 139136 | 10708982 | 1299.2 |
Denmark | 19816 | 5792203 | 342.1 |
Diamond Princess | 0 | 0 | NaN |
Djibouti | 62 | 988002 | 6.3 |
Dominica | 21 | 71991 | 29.2 |
Dominican Republic | 16004 | 10847904 | 147.5 |
Ecuador | 12353 | 17643060 | 70.0 |
Egypt | 13742 | 102334403 | 13.4 |
El Salvador | 4197 | 6486201 | 64.7 |
Equatorial Guinea | 39 | 1402985 | 2.8 |
Eritrea | 557 | 3546427 | 15.7 |
Estonia | 7307 | 1326539 | 550.8 |
Eswatini | 2821 | 1160164 | 243.2 |
Ethiopia | 5277 | 114963583 | 4.6 |
Fiji | 4 | 896444 | 0.4 |
Finland | 3307 | 5540718 | 59.7 |
France | 230916 | 65273512 | 353.8 |
Gabon | 328 | 2225728 | 14.7 |
Gambia | 97 | 2416664 | 4.0 |
Georgia | 17037 | 3989175 | 427.1 |
Germany | 250288 | 83783945 | 298.7 |
Ghana | 1917 | 31072945 | 6.2 |
Greece | 8151 | 10423056 | 78.2 |
Grenada | 12 | 112519 | 10.7 |
Guatemala | 9244 | 17915567 | 51.6 |
Guinea | 281 | 13132792 | 2.1 |
Guinea-Bissau | 26 | 1967998 | 1.3 |
Guyana | 454 | 786559 | 57.7 |
Haiti | 558 | 11402533 | 4.9 |
Holy See | 0 | 809 | 0.0 |
Honduras | 9268 | 9904608 | 93.6 |
Hungary | 22461 | 9660350 | 232.5 |
Iceland | 202 | 341250 | 59.2 |
India | 218876 | 1380004385 | 15.9 |
Indonesia | 123945 | 273523621 | 45.3 |
Iran | 80821 | 83992953 | 96.2 |
Iraq | 9958 | 40222503 | 24.8 |
Ireland | 69622 | 4937796 | 1410.0 |
Israel | 100250 | 8655541 | 1158.2 |
Italy | 211222 | 60461828 | 349.3 |
Jamaica | 1061 | 2961161 | 35.8 |
Japan | 75774 | 126476458 | 59.9 |
Jordan | 16183 | 10203140 | 158.6 |
Kazakhstan | 10975 | 18776707 | 58.5 |
Kenya | 2181 | 53771300 | 4.1 |
Korea, South | 8576 | 51269183 | 16.7 |
Kosovo | 3633 | 1810366 | 200.7 |
Kuwait | 5890 | 4270563 | 137.9 |
Kyrgyzstan | 1772 | 6524191 | 27.2 |
Laos | 0 | 7275556 | 0.0 |
Latvia | 12137 | 1886202 | 643.5 |
Lebanon | 56878 | 6825442 | 833.3 |
Lesotho | 3165 | 2142252 | 147.7 |
Liberia | 103 | 5057677 | 2.0 |
Libya | 7273 | 6871287 | 105.8 |
Liechtenstein | 176 | 38137 | 461.5 |
Lithuania | 20161 | 2722291 | 740.6 |
Luxembourg | 2215 | 625976 | 353.8 |
MS Zaandam | 0 | 0 | NaN |
Madagascar | 234 | 27691019 | 0.8 |
Malawi | 4511 | 19129955 | 23.6 |
Malaysia | 33693 | 32365998 | 104.1 |
Maldives | 541 | 540542 | 100.1 |
Mali | 574 | 20250834 | 2.8 |
Malta | 2275 | 441539 | 515.2 |
Marshall Islands | 0 | 58413 | 0.0 |
Mauritania | 1286 | 4649660 | 27.7 |
Mauritius | 20 | 1271767 | 1.6 |
Mexico | 166191 | 127792286 | 130.0 |
Moldova | 6569 | 4033963 | 162.8 |
Monaco | 268 | 39244 | 682.9 |
Mongolia | 249 | 3278292 | 7.6 |
Montenegro | 5874 | 628062 | 935.3 |
Morocco | 15484 | 36910558 | 42.0 |
Mozambique | 6036 | 31255435 | 19.3 |
Namibia | 5235 | 2540916 | 206.0 |
Nepal | 5378 | 29136808 | 18.5 |
Netherlands | 89139 | 17134873 | 520.2 |
New Zealand | 65 | 4822233 | 1.3 |
Nicaragua | 106 | 6624554 | 1.6 |
Niger | 668 | 24206636 | 2.8 |
Nigeria | 18182 | 206139587 | 8.8 |
North Macedonia | 4600 | 2083380 | 220.8 |
Norway | 7936 | 5421242 | 146.4 |
Oman | 2397 | 5106622 | 46.9 |
Pakistan | 30136 | 220892331 | 13.6 |
Panama | 41828 | 4314768 | 969.4 |
Papua New Guinea | 54 | 8947027 | 0.6 |
Paraguay | 12071 | 7132530 | 169.2 |
Peru | 40886 | 32971846 | 124.0 |
Philippines | 19730 | 109581085 | 18.0 |
Poland | 109540 | 37846605 | 289.4 |
Portugal | 104599 | 10196707 | 1025.8 |
Qatar | 2645 | 2881060 | 91.8 |
Romania | 50875 | 19237682 | 264.5 |
Russia | 303633 | 145934460 | 208.1 |
Rwanda | 2006 | 12952209 | 15.5 |
Saint Kitts and Nevis | 1 | 53192 | 1.9 |
Saint Lucia | 223 | 183629 | 121.4 |
Saint Vincent and the Grenadines | 328 | 110947 | 295.6 |
Samoa | 0 | 196130 | 0.0 |
San Marino | 339 | 33938 | 998.9 |
Sao Tome and Principe | 101 | 219161 | 46.1 |
Saudi Arabia | 1634 | 34813867 | 4.7 |
Senegal | 2885 | 16743930 | 17.2 |
Serbia | 27919 | 8737370 | 319.5 |
Seychelles | 371 | 98340 | 377.3 |
Sierra Leone | 313 | 7976985 | 3.9 |
Singapore | 397 | 5850343 | 6.8 |
Slovakia | 34463 | 5459643 | 631.2 |
Slovenia | 22673 | 2078932 | 1090.6 |
Solomon Islands | 0 | 652858 | 0.0 |
Somalia | 30 | 15893219 | 0.2 |
South Africa | 222797 | 59308690 | 375.7 |
South Sudan | 112 | 11193729 | 1.0 |
Spain | 323899 | 46754783 | 692.8 |
Sri Lanka | 7223 | 21413250 | 33.7 |
Sudan | 2414 | 43849269 | 5.5 |
Suriname | 1066 | 586634 | 181.7 |
Sweden | 86107 | 10099270 | 852.6 |
Switzerland | 42932 | 8654618 | 496.1 |
Syria | 1234 | 17500657 | 7.1 |
Taiwan* | 35 | 23816775 | 0.1 |
Tajikistan | 8 | 9537642 | 0.1 |
Tanzania | 0 | 59734213 | 0.0 |
Thailand | 3986 | 69799978 | 5.7 |
Timor-Leste | 7 | 1318442 | 0.5 |
Togo | 537 | 8278737 | 6.5 |
Trinidad and Tobago | 181 | 1399491 | 12.9 |
Tunisia | 33086 | 11818618 | 279.9 |
Turkey | 141080 | 84339067 | 167.3 |
US | 3037534 | 329466283 | 922.0 |
Uganda | 2373 | 45741000 | 5.2 |
Ukraine | 81707 | 43733759 | 186.8 |
United Arab Emirates | 34735 | 9890400 | 351.2 |
United Kingdom | 718100 | 67886004 | 1057.8 |
Uruguay | 10671 | 3473727 | 307.2 |
Uzbekistan | 722 | 33469199 | 2.2 |
Vanuatu | 0 | 292680 | 0.0 |
Venezuela | 4773 | 28435943 | 16.8 |
Vietnam | 54 | 97338583 | 0.1 |
West Bank and Gaza | 10855 | 5101416 | 212.8 |
Yemen | 10 | 29825968 | 0.0 |
Zambia | 13048 | 18383956 | 71.0 |
Zimbabwe | 11618 | 14862927 | 78.2 |
cases_incidence.sort_values(by=['14-day-incidence-rate'], ascending=False)
14-day-sum | population | 14-day-incidence-rate | |
---|---|---|---|
Country | |||
Ireland | 69622 | 4937796 | 1410.0 |
Czechia | 139136 | 10708982 | 1299.2 |
Israel | 100250 | 8655541 | 1158.2 |
Slovenia | 22673 | 2078932 | 1090.6 |
United Kingdom | 718100 | 67886004 | 1057.8 |
Portugal | 104599 | 10196707 | 1025.8 |
Andorra | 780 | 77265 | 1009.5 |
San Marino | 339 | 33938 | 998.9 |
Panama | 41828 | 4314768 | 969.4 |
Montenegro | 5874 | 628062 | 935.3 |
US | 3037534 | 329466283 | 922.0 |
Sweden | 86107 | 10099270 | 852.6 |
Lebanon | 56878 | 6825442 | 833.3 |
Lithuania | 20161 | 2722291 | 740.6 |
Spain | 323899 | 46754783 | 692.8 |
Monaco | 268 | 39244 | 682.9 |
Latvia | 12137 | 1886202 | 643.5 |
Slovakia | 34463 | 5459643 | 631.2 |
Estonia | 7307 | 1326539 | 550.8 |
Netherlands | 89139 | 17134873 | 520.2 |
Malta | 2275 | 441539 | 515.2 |
Switzerland | 42932 | 8654618 | 496.1 |
Liechtenstein | 176 | 38137 | 461.5 |
Cyprus | 5164 | 1207361 | 427.7 |
Georgia | 17037 | 3989175 | 427.1 |
Colombia | 203771 | 50882884 | 400.5 |
Seychelles | 371 | 98340 | 377.3 |
South Africa | 222797 | 59308690 | 375.7 |
France | 230916 | 65273512 | 353.8 |
Luxembourg | 2215 | 625976 | 353.8 |
United Arab Emirates | 34735 | 9890400 | 351.2 |
Italy | 211222 | 60461828 | 349.3 |
Denmark | 19816 | 5792203 | 342.1 |
Argentina | 148213 | 45195777 | 327.9 |
Serbia | 27919 | 8737370 | 319.5 |
Brazil | 677087 | 212559409 | 318.5 |
Uruguay | 10671 | 3473727 | 307.2 |
Germany | 250288 | 83783945 | 298.7 |
Saint Vincent and the Grenadines | 328 | 110947 | 295.6 |
Austria | 26486 | 9006400 | 294.1 |
Canada | 110603 | 37855702 | 292.2 |
Costa Rica | 14866 | 5094114 | 291.8 |
Poland | 109540 | 37846605 | 289.4 |
Croatia | 11550 | 4105268 | 281.3 |
Tunisia | 33086 | 11818618 | 279.9 |
Albania | 7644 | 2877800 | 265.6 |
Romania | 50875 | 19237682 | 264.5 |
Belarus | 23479 | 9449321 | 248.5 |
Eswatini | 2821 | 1160164 | 243.2 |
Chile | 45278 | 19116209 | 236.9 |
Hungary | 22461 | 9660350 | 232.5 |
Bahrain | 3836 | 1701583 | 225.4 |
Belgium | 25920 | 11589616 | 223.6 |
Barbados | 641 | 287371 | 223.1 |
North Macedonia | 4600 | 2083380 | 220.8 |
West Bank and Gaza | 10855 | 5101416 | 212.8 |
Russia | 303633 | 145934460 | 208.1 |
Namibia | 5235 | 2540916 | 206.0 |
Kosovo | 3633 | 1810366 | 200.7 |
Ukraine | 81707 | 43733759 | 186.8 |
Bolivia | 21534 | 11673029 | 184.5 |
Suriname | 1066 | 586634 | 181.7 |
Belize | 722 | 397621 | 181.6 |
Paraguay | 12071 | 7132530 | 169.2 |
Turkey | 141080 | 84339067 | 167.3 |
Moldova | 6569 | 4033963 | 162.8 |
Cabo Verde | 893 | 555988 | 160.6 |
Jordan | 16183 | 10203140 | 158.6 |
Bosnia and Herzegovina | 4868 | 3280815 | 148.4 |
Lesotho | 3165 | 2142252 | 147.7 |
Dominican Republic | 16004 | 10847904 | 147.5 |
Norway | 7936 | 5421242 | 146.4 |
Armenia | 4174 | 2963234 | 140.9 |
Kuwait | 5890 | 4270563 | 137.9 |
Mexico | 166191 | 127792286 | 130.0 |
Bulgaria | 8623 | 6948445 | 124.1 |
Peru | 40886 | 32971846 | 124.0 |
Saint Lucia | 223 | 183629 | 121.4 |
Botswana | 2560 | 2351625 | 108.9 |
Libya | 7273 | 6871287 | 105.8 |
Malaysia | 33693 | 32365998 | 104.1 |
Maldives | 541 | 540542 | 100.1 |
Iran | 80821 | 83992953 | 96.2 |
Honduras | 9268 | 9904608 | 93.6 |
Qatar | 2645 | 2881060 | 91.8 |
Zimbabwe | 11618 | 14862927 | 78.2 |
Greece | 8151 | 10423056 | 78.2 |
Zambia | 13048 | 18383956 | 71.0 |
Ecuador | 12353 | 17643060 | 70.0 |
Azerbaijan | 7087 | 10139175 | 69.9 |
Comoros | 605 | 869595 | 69.6 |
El Salvador | 4197 | 6486201 | 64.7 |
Japan | 75774 | 126476458 | 59.9 |
Finland | 3307 | 5540718 | 59.7 |
Iceland | 202 | 341250 | 59.2 |
Kazakhstan | 10975 | 18776707 | 58.5 |
Guyana | 454 | 786559 | 57.7 |
Guatemala | 9244 | 17915567 | 51.6 |
Oman | 2397 | 5106622 | 46.9 |
Sao Tome and Principe | 101 | 219161 | 46.1 |
Indonesia | 123945 | 273523621 | 45.3 |
Cuba | 4871 | 11326616 | 43.0 |
Morocco | 15484 | 36910558 | 42.0 |
Jamaica | 1061 | 2961161 | 35.8 |
Bahamas | 134 | 393248 | 34.1 |
Sri Lanka | 7223 | 21413250 | 33.7 |
Dominica | 21 | 71991 | 29.2 |
Mauritania | 1286 | 4649660 | 27.7 |
Kyrgyzstan | 1772 | 6524191 | 27.2 |
Antigua and Barbuda | 25 | 97928 | 25.5 |
Iraq | 9958 | 40222503 | 24.8 |
Malawi | 4511 | 19129955 | 23.6 |
Mozambique | 6036 | 31255435 | 19.3 |
Nepal | 5378 | 29136808 | 18.5 |
Philippines | 19730 | 109581085 | 18.0 |
Senegal | 2885 | 16743930 | 17.2 |
Venezuela | 4773 | 28435943 | 16.8 |
Korea, South | 8576 | 51269183 | 16.7 |
Bhutan | 127 | 771612 | 16.5 |
India | 218876 | 1380004385 | 15.9 |
Eritrea | 557 | 3546427 | 15.7 |
Rwanda | 2006 | 12952209 | 15.5 |
Gabon | 328 | 2225728 | 14.7 |
Burma | 7762 | 54409794 | 14.3 |
Pakistan | 30136 | 220892331 | 13.6 |
Egypt | 13742 | 102334403 | 13.4 |
Trinidad and Tobago | 181 | 1399491 | 12.9 |
Congo (Brazzaville) | 602 | 5518092 | 10.9 |
Grenada | 12 | 112519 | 10.7 |
Burkina Faso | 1942 | 20903278 | 9.3 |
Nigeria | 18182 | 206139587 | 8.8 |
Cote d'Ivoire | 2293 | 26378275 | 8.7 |
Mongolia | 249 | 3278292 | 7.6 |
Algeria | 3222 | 43851043 | 7.3 |
Syria | 1234 | 17500657 | 7.1 |
Bangladesh | 11301 | 164689383 | 6.9 |
Singapore | 397 | 5850343 | 6.8 |
Togo | 537 | 8278737 | 6.5 |
Djibouti | 62 | 988002 | 6.3 |
Ghana | 1917 | 31072945 | 6.2 |
Afghanistan | 2305 | 38928341 | 5.9 |
Thailand | 3986 | 69799978 | 5.7 |
Sudan | 2414 | 43849269 | 5.5 |
Uganda | 2373 | 45741000 | 5.2 |
Haiti | 558 | 11402533 | 4.9 |
Saudi Arabia | 1634 | 34813867 | 4.7 |
Ethiopia | 5277 | 114963583 | 4.6 |
Kenya | 2181 | 53771300 | 4.1 |
Gambia | 97 | 2416664 | 4.0 |
Chad | 638 | 16425859 | 3.9 |
Sierra Leone | 313 | 7976985 | 3.9 |
Brunei | 17 | 437483 | 3.9 |
Angola | 1071 | 32866268 | 3.3 |
Congo (Kinshasa) | 2558 | 89561404 | 2.9 |
Mali | 574 | 20250834 | 2.8 |
Burundi | 328 | 11890781 | 2.8 |
Equatorial Guinea | 39 | 1402985 | 2.8 |
Niger | 668 | 24206636 | 2.8 |
Uzbekistan | 722 | 33469199 | 2.2 |
Guinea | 281 | 13132792 | 2.1 |
Liberia | 103 | 5057677 | 2.0 |
Saint Kitts and Nevis | 1 | 53192 | 1.9 |
Cameroon | 488 | 26545864 | 1.8 |
Nicaragua | 106 | 6624554 | 1.6 |
Mauritius | 20 | 1271767 | 1.6 |
Guinea-Bissau | 26 | 1967998 | 1.3 |
Benin | 162 | 12123198 | 1.3 |
New Zealand | 65 | 4822233 | 1.3 |
South Sudan | 112 | 11193729 | 1.0 |
Australia | 205 | 25459700 | 0.8 |
Madagascar | 234 | 27691019 | 0.8 |
Papua New Guinea | 54 | 8947027 | 0.6 |
Timor-Leste | 7 | 1318442 | 0.5 |
Fiji | 4 | 896444 | 0.4 |
Cambodia | 55 | 16718971 | 0.3 |
Central African Republic | 10 | 4829764 | 0.2 |
Somalia | 30 | 15893219 | 0.2 |
China | 1530 | 1404676330 | 0.1 |
Tajikistan | 8 | 9537642 | 0.1 |
Vietnam | 54 | 97338583 | 0.1 |
Taiwan* | 35 | 23816775 | 0.1 |
Marshall Islands | 0 | 58413 | 0.0 |
Solomon Islands | 0 | 652858 | 0.0 |
Holy See | 0 | 809 | 0.0 |
Tanzania | 0 | 59734213 | 0.0 |
Vanuatu | 0 | 292680 | 0.0 |
Yemen | 10 | 29825968 | 0.0 |
Samoa | 0 | 196130 | 0.0 |
Laos | 0 | 7275556 | 0.0 |
Diamond Princess | 0 | 0 | NaN |
MS Zaandam | 0 | 0 | NaN |
from oscovida import fetch_cases, get_population
import datetime
period = 14 # Days we compute the incidence rate over
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
cases_germany = cases.loc['Germany'][2:] # First 2 entries are lat/lon so we only take the subsequent ones
cases_germany.tail()
1/11/21 1941116.0 1/12/21 1968326.0 1/13/21 1993892.0 1/14/21 2015235.0 1/15/21 2023828.0 Name: Germany, dtype: float64
yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
x_days_ago = yesterday - datetime.timedelta(days=period)
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
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
1/2/21 NaN 1/3/21 10356.0 1/4/21 12320.0 1/5/21 18349.0 1/6/21 26663.0 1/7/21 45333.0 1/8/21 19077.0 1/9/21 22824.0 1/10/21 948.0 1/11/21 11706.0 1/12/21 27210.0 1/13/21 25566.0 1/14/21 21343.0 1/15/21 8593.0 Name: Germany, dtype: float64
cases_in_period_per_day_germany.plot() # We can easily look at new cases per day
<AxesSubplot:>
population = get_population().population
population_germany = population.loc['Germany'] # Get the population of Germany
population_germany
83783945.0
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
298.73026389483095