diff --git a/module3/exo1/analyse-syndrome-grippal.ipynb b/module3/exo1/analyse-syndrome-grippal.ipynb index 59d72b5b58a3ae26346460dd39e62a39c55243d7..1b2cca1b4dba9f70ff7be93a06c9aa36207679f6 100644 --- a/module3/exo1/analyse-syndrome-grippal.ipynb +++ b/module3/exo1/analyse-syndrome-grippal.ipynb @@ -9,14 +9,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", - "import isoweek" + "import isoweek\n", + "import os.path" ] }, { @@ -28,10 +29,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 3, + "metadata": {}, "outputs": [], "source": [ "data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"" @@ -61,12 +60,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "raw_data = pd.read_csv(data_url, skiprows=1)\n", - "raw_data" + "from pathlib import Path\n", + "my_file = Path(\"data_file.csv\")\n", + "if my_file.exists():\n", + " raw_data = pd.read_csv(my_file, skiprows=1)\n", + "else:\n", + " raw_data = pd.read_csv(data_url, skiprows=1)\n", + " raw_data.to_csv(\"data_file.csv\")" ] }, { @@ -364,9 +368,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.1" + "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 1 -} +} \ No newline at end of file