ccc

parent 600f2458
This diff is collapsed.
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"The data on the incidence of influenza-like illness are available from the Web site of the [Réseau Sentinelles](https://www.sentiweb.fr/france/en/?). We download them as a file in CSV format, in which each line corresponds to a week in the observation period. Only the complete dataset, starting in 1984 and ending with a recent week, is available for download." "The data on the incidence of influenza-like illness are available from the Web site of the [Réseau Sentinelles](https://www.sentiweb.fr/france/en/?). We download them as a file in CSV format, in which each line corresponds to a week in the observation period. Only the complete dataset, starting in 1984 and ending with a recent week, is available for download. \n",
"In case the online link is not working, the data in local repo is used."
] ]
}, },
{ {
...@@ -32,7 +33,14 @@ ...@@ -32,7 +33,14 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"" "data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"\n",
"\n",
"data_file = \"inc-3-PAY.csv\"\n",
"\n",
"import os\n",
"import urllib.request\n",
"if not os.path.exists(data_file):\n",
" urllib.request.urlretrieve(data_url, data_file)"
] ]
}, },
{ {
...@@ -1030,7 +1038,7 @@ ...@@ -1030,7 +1038,7 @@
} }
], ],
"source": [ "source": [
"raw_data = pd.read_csv(data_url, skiprows=1)\n", "raw_data = pd.read_csv(data_file, skiprows=1)\n",
"raw_data" "raw_data"
] ]
}, },
...@@ -2267,9 +2275,7 @@ ...@@ -2267,9 +2275,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [], "outputs": [],
"source": [ "source": [
"first_august_week = [pd.Period(pd.Timestamp(y, 8, 1), 'W')\n", "first_august_week = [pd.Period(pd.Timestamp(y, 8, 1), 'W')\n",
...@@ -2289,9 +2295,7 @@ ...@@ -2289,9 +2295,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [], "outputs": [],
"source": [ "source": [
"year = []\n", "year = []\n",
...@@ -2357,9 +2361,7 @@ ...@@ -2357,9 +2361,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [], "outputs": [],
"source": [] "source": []
} }
......
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