add explanation

parent 624bf32a
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import pandas as pd\n", "import pandas as pd\n",
"import os.path\n", "import os.path\n",
"from os import path\n",
"import urllib.request\n", "import urllib.request\n",
"import isoweek" "import isoweek"
] ]
...@@ -60,6 +59,13 @@ ...@@ -60,6 +59,13 @@
"La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant `skiprows=1`." "La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant `skiprows=1`."
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pour nous protéger contre une éventuelle disparition ou modification du serveur du Réseau Sentinelles, nous faisons une copie locale de ce jeux de données que nous préservons avec notre analyse. Il est inutile et même risquée de télécharger les données à chaque exécution, car dans le cas d'une panne nous pourrions remplacer nos données par un fichier défectueux. Pour cette raison, nous téléchargeons les données seulement si la copie locale n'existe pas."
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 3,
...@@ -1033,9 +1039,10 @@ ...@@ -1033,9 +1039,10 @@
} }
], ],
"source": [ "source": [
"if not path.exists('incidence-grippalle.csv'):\n", "data_file = \"incidence-grippalle.csv\"\n",
" urllib.request.urlretrieve(data_url, 'incidence-grippalle.csv')\n", "if not os.path.exists(data_file):\n",
"raw_data = pd.read_csv('incidence-grippalle.csv', skiprows=1)\n", " urllib.request.urlretrieve(data_url, data_file)\n",
"raw_data = pd.read_csv(data_file, skiprows=1)\n",
"raw_data" "raw_data"
] ]
}, },
...@@ -2212,7 +2219,7 @@ ...@@ -2212,7 +2219,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb151fa1d30>" "<matplotlib.axes._subplots.AxesSubplot at 0x7f3fd4de2860>"
] ]
}, },
"execution_count": 9, "execution_count": 9,
...@@ -2251,7 +2258,7 @@ ...@@ -2251,7 +2258,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb14fe63a58>" "<matplotlib.axes._subplots.AxesSubplot at 0x7f3fd2c3a5f8>"
] ]
}, },
"execution_count": 10, "execution_count": 10,
...@@ -2355,7 +2362,7 @@ ...@@ -2355,7 +2362,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb14fd92780>" "<matplotlib.axes._subplots.AxesSubplot at 0x7f3fd2bc9f28>"
] ]
}, },
"execution_count": 13, "execution_count": 13,
...@@ -2456,7 +2463,7 @@ ...@@ -2456,7 +2463,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fb14fcee908>" "<matplotlib.axes._subplots.AxesSubplot at 0x7f3fd2bc9208>"
] ]
}, },
"execution_count": 15, "execution_count": 15,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment