From 206c14b37f94d5b96310b9329a6d6d86804a78ed Mon Sep 17 00:00:00 2001 From: c356ed33d414d53760b5d8b0a508adc0 Date: Fri, 12 Mar 2021 16:07:43 +0000 Subject: [PATCH] =?UTF-8?q?Module=203,=20exo=201:=20t=C3=A9l=C3=A9charge?= =?UTF-8?q?=20si=20pas=20pr=C3=A9setn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module3/exo1/analyse-syndrome-grippal.ipynb | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/module3/exo1/analyse-syndrome-grippal.ipynb b/module3/exo1/analyse-syndrome-grippal.ipynb index 2eeedcb..eaffc4f 100644 --- a/module3/exo1/analyse-syndrome-grippal.ipynb +++ b/module3/exo1/analyse-syndrome-grippal.ipynb @@ -32,8 +32,7 @@ "metadata": {}, "outputs": [], "source": [ - "filename = 'incidence-PAY-3.csv'\n", - "data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"" + "filename = 'incidence-PAY-3.csv'" ] }, { @@ -60,8 +59,10 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, + "execution_count": 16, + "metadata": { + "scrolled": false + }, "outputs": [ { "data": { @@ -1025,13 +1026,18 @@ "[1897 rows x 10 columns]" ] }, - "execution_count": 3, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "raw_data = pd.read_csv(filename, skiprows=1)\n", + "# Si le fichier de données n'est pas présent, il sera téléchargé depuis le serveur.\n", + "try:\n", + " raw_data = pd.read_csv(filename, skiprows=1)\n", + "except FileNotFoundError:\n", + " !wget \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"\n", + " raw_data = pd.read_csv(filename, skiprows=1)\n", "raw_data" ] }, @@ -2208,7 +2214,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -2247,7 +2253,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 10, @@ -2351,7 +2357,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -2453,7 +2459,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 15, -- 2.18.1