Module 3 - Exo 1

parent 2bd12eef
......@@ -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
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