Skip to content

Commit

Permalink
update mar 15
Browse files Browse the repository at this point in the history
  • Loading branch information
paaatcha committed Mar 16, 2020
1 parent 69ae744 commit ea2961a
Show file tree
Hide file tree
Showing 79 changed files with 25,845 additions and 25,083 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
PAD/results/*
figures/

*.sh

Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,41 @@
## Overview
On March 11, 2020, the World Health Organization (WHO) declared the Covid-19 (a.k.a. new coronavirus) a pandemic. Since January 22, 2020, the Johns Hopkins CSSE maintains a [data repository](https://github.com/CSSEGISandData/COVID-19) to track the Covid-19 incidence worldwide. In order to understand a little bit how this disease will affect my country (Brazil), I performed some data analysis in this data.

For Portuguese speakers, I wrote a post in my blog about this analysis: [O que os dados dizem sobre o Coronavírus?](http://computacaointeligente.com.br/coolstuffs/analisando-coronavirus/)

## Some plots and tables got during the analysis (updated on March 15, 2020)
### Covid-19 worldwide (without China):
![covid-19-wo-chinha](figures/en/conf_cases_worldwide_no_china.png)

### Deaths worldwide (without China):
![deaths-wo-chinha](figures/en/deaths_worldwide_no_china.png)


### Top 10 infected countries
| Country/Region | Confirmed | Deaths | Recovered | % Deaths | % Population |
|:-----------------|------------:|---------:|------------:|------------:|-----------:|
| China | 81003 | 3203 | 67017 | 3.95417 | 0.00581613 |
| Italy | 24747 | 1809 | 2335 | 7.30998 | 0.0409506 |
| Iran | 13938 | 724 | 4590 | 5.19443 | 0.0170391 |
| Korea, South | 8162 | 75 | 510 | 0.918892 | 0.015807 |
| Spain | 7798 | 289 | 517 | 3.70608 | 0.0166896 |
| Germany | 5795 | 11 | 46 | 0.189819 | 0.006988 |
| France | 4513 | 91 | 12 | 2.0164 | 0.0067371 |
| US | 3499 | 63 | 12 | 1.80051 | 0.00106948 |
| Switzerland | 2200 | 14 | 4 | 0.636364 | 0.0258321 |
| Norway | 1221 | 3 | 1 | 0.2457 | 0.0229756 |

### Comparing confirmed cases around the world

![comparing-countries](figures/en/conf_cases_countries.png)

### Early cases in Brazil
![early-br](figures/en/early_cases_conf_brazil.png)

### Comparing early cases around the world
![early-compare](figures/en/conf_early_cases_countries.png)


## Running the code
The analysis was coded in Python using Jupyter Notebook. To install the requirement:

Expand All @@ -19,5 +54,6 @@ Some people are also working on this data and providing some insightful analysis
- [Novel Corona Virus 2019 Dataset](https://www.kaggle.com/sudalairajkumar/novel-corona-virus-2019-dataset)



**If you find some bug or have any further question please let me know**

439 changes: 230 additions & 209 deletions analysis.ipynb

Large diffs are not rendered by default.

47,552 changes: 24,213 additions & 23,339 deletions data/clean_data.csv

Large diffs are not rendered by default.

894 changes: 451 additions & 443 deletions data/raw/Confirmed_cases.csv

Large diffs are not rendered by default.

894 changes: 451 additions & 443 deletions data/raw/Deaths_cases.csv

Large diffs are not rendered by default.

894 changes: 451 additions & 443 deletions data/raw/Recovered_cases.csv

Large diffs are not rendered by default.

Binary file added figures/en/age_distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_countries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_USA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_brazil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_canada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_china.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_france.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_germany.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_iran.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_italy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_in_span.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_worldwide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_cases_worldwide_no_china.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/conf_early_cases_countries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_USA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_brazil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_canada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_france.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_germany.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_iran.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_italy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_korea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_in_spain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_worldwide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/deaths_worldwide_no_china.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/en/early_cases_conf_USA.png
Binary file added figures/en/early_cases_conf_brazil.png
Binary file added figures/en/early_cases_conf_canada.png
Binary file added figures/en/early_cases_conf_france.png
Binary file added figures/en/early_cases_conf_germany.png
Binary file added figures/en/early_cases_conf_iran.png
Binary file added figures/en/early_cases_conf_italia.png
Binary file added figures/en/early_cases_conf_korea.png
Binary file added figures/en/early_cases_conf_spain.png
Binary file added figures/en/mortes_in_china.png
Binary file added figures/pt/casos_conf_EUA.png
Binary file added figures/pt/casos_conf_alemanha.png
Binary file added figures/pt/casos_conf_brasil.png
Binary file added figures/pt/casos_conf_canada.png
Binary file added figures/pt/casos_conf_coreia.png
Binary file added figures/pt/casos_conf_espanha.png
Binary file added figures/pt/casos_conf_france.png
Binary file added figures/pt/casos_conf_iran.png
Binary file added figures/pt/casos_conf_italia.png
Binary file added figures/pt/casos_conf_mundo.png
Binary file added figures/pt/casos_conf_mundo_sem_china.png
Binary file added figures/pt/casos_conf_na_china.png
Binary file added figures/pt/casos_confirmados_paises.png
Binary file added figures/pt/distribuicao_idades.png
Binary file added figures/pt/mortes_china.png
Binary file added figures/pt/mortes_mundo.png
Binary file added figures/pt/mortes_mundo_sem_china.png
Binary file added figures/pt/mortes_na_EUA.png
Binary file added figures/pt/mortes_na_alemanha.png
Binary file added figures/pt/mortes_na_brasil.png
Binary file added figures/pt/mortes_na_canada.png
Binary file added figures/pt/mortes_na_coreia.png
Binary file added figures/pt/mortes_na_espanha.png
Binary file added figures/pt/mortes_na_franca.png
Binary file added figures/pt/mortes_na_iran.png
Binary file added figures/pt/mortes_na_italia.png
Binary file added figures/pt/prim_casos_conf_EUA.png
Binary file added figures/pt/prim_casos_conf_alemanha.png
Binary file added figures/pt/prim_casos_conf_brasil.png
Binary file added figures/pt/prim_casos_conf_canada.png
Binary file added figures/pt/prim_casos_conf_coreia.png
Binary file added figures/pt/prim_casos_conf_espanha.png
Binary file added figures/pt/prim_casos_conf_france.png
Binary file added figures/pt/prim_casos_conf_iran.png
Binary file added figures/pt/prim_casos_conf_italia.png
Binary file added figures/pt/primeiros_casos_paises.png
217 changes: 13 additions & 204 deletions get_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -35,217 +35,26 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"- Downloading Confirmed ...\n",
"- Downloading Recovered ...\n",
"- Downloading Deaths ...\n",
"- Done!\n"
"- Downloading Confirmed ...\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Province/State</th>\n",
" <th>Country/Region</th>\n",
" <th>Lat</th>\n",
" <th>Long</th>\n",
" <th>1/22/20</th>\n",
" <th>1/23/20</th>\n",
" <th>1/24/20</th>\n",
" <th>1/25/20</th>\n",
" <th>1/26/20</th>\n",
" <th>1/27/20</th>\n",
" <th>...</th>\n",
" <th>3/5/20</th>\n",
" <th>3/6/20</th>\n",
" <th>3/7/20</th>\n",
" <th>3/8/20</th>\n",
" <th>3/9/20</th>\n",
" <th>3/10/20</th>\n",
" <th>3/11/20</th>\n",
" <th>3/12/20</th>\n",
" <th>3/13/20</th>\n",
" <th>3/14/20</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>NaN</td>\n",
" <td>Thailand</td>\n",
" <td>15.0000</td>\n",
" <td>101.0000</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>5</td>\n",
" <td>7</td>\n",
" <td>8</td>\n",
" <td>8</td>\n",
" <td>...</td>\n",
" <td>47</td>\n",
" <td>48</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>53</td>\n",
" <td>59</td>\n",
" <td>70</td>\n",
" <td>75</td>\n",
" <td>82</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>NaN</td>\n",
" <td>Japan</td>\n",
" <td>36.0000</td>\n",
" <td>138.0000</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>4</td>\n",
" <td>...</td>\n",
" <td>360</td>\n",
" <td>420</td>\n",
" <td>461</td>\n",
" <td>502</td>\n",
" <td>511</td>\n",
" <td>581</td>\n",
" <td>639</td>\n",
" <td>639</td>\n",
" <td>701</td>\n",
" <td>773</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>NaN</td>\n",
" <td>Singapore</td>\n",
" <td>1.2833</td>\n",
" <td>103.8333</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>4</td>\n",
" <td>5</td>\n",
" <td>...</td>\n",
" <td>117</td>\n",
" <td>130</td>\n",
" <td>138</td>\n",
" <td>150</td>\n",
" <td>150</td>\n",
" <td>160</td>\n",
" <td>178</td>\n",
" <td>178</td>\n",
" <td>200</td>\n",
" <td>212</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>NaN</td>\n",
" <td>Nepal</td>\n",
" <td>28.1667</td>\n",
" <td>84.2500</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>NaN</td>\n",
" <td>Malaysia</td>\n",
" <td>2.5000</td>\n",
" <td>112.5000</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>4</td>\n",
" <td>4</td>\n",
" <td>...</td>\n",
" <td>50</td>\n",
" <td>83</td>\n",
" <td>93</td>\n",
" <td>99</td>\n",
" <td>117</td>\n",
" <td>129</td>\n",
" <td>149</td>\n",
" <td>149</td>\n",
" <td>197</td>\n",
" <td>238</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5 rows × 57 columns</p>\n",
"</div>"
],
"text/plain": [
" Province/State Country/Region Lat Long 1/22/20 1/23/20 1/24/20 \\\n",
"0 NaN Thailand 15.0000 101.0000 2 3 5 \n",
"1 NaN Japan 36.0000 138.0000 2 1 2 \n",
"2 NaN Singapore 1.2833 103.8333 0 1 3 \n",
"3 NaN Nepal 28.1667 84.2500 0 0 0 \n",
"4 NaN Malaysia 2.5000 112.5000 0 0 0 \n",
"\n",
" 1/25/20 1/26/20 1/27/20 ... 3/5/20 3/6/20 3/7/20 3/8/20 3/9/20 \\\n",
"0 7 8 8 ... 47 48 50 50 50 \n",
"1 2 4 4 ... 360 420 461 502 511 \n",
"2 3 4 5 ... 117 130 138 150 150 \n",
"3 1 1 1 ... 1 1 1 1 1 \n",
"4 3 4 4 ... 50 83 93 99 117 \n",
"\n",
" 3/10/20 3/11/20 3/12/20 3/13/20 3/14/20 \n",
"0 53 59 70 75 82 \n",
"1 581 639 639 701 773 \n",
"2 160 178 178 200 212 \n",
"3 1 1 1 1 1 \n",
"4 129 149 149 197 238 \n",
"\n",
"[5 rows x 57 columns]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
"ename": "NameError",
"evalue": "name 'urllib' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-dd4935cb1b7b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0murl_key\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mURLS\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"- Downloading\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl_key\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"...\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0murllib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0murlretrieve\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mURLS\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0murl_key\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'data/raw/{}_cases.csv'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl_key\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 12\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"- Done!\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'urllib' is not defined"
]
}
],
"source": [
Expand Down Expand Up @@ -444,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down

0 comments on commit ea2961a

Please sign in to comment.