url -> local

parent cd91d8e6
...@@ -28,10 +28,8 @@ ...@@ -28,10 +28,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 15,
"metadata": { "metadata": {},
"collapsed": true
},
"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\""
...@@ -63,29 +61,36 @@ ...@@ -63,29 +61,36 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Data is stored in the local dir exo1, set the local path" "Download data from url and save to the local dir (check if not exist)"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 18,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"local_path = 'incidence-PAY-3.csv'" "data_file = \"syndrome-grippal.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)"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Now replace the data_url by the local_path" "Now replace the data_url by the data_file "
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 20,
"metadata": {}, "metadata": {
"scrolled": true
},
"outputs": [ "outputs": [
{ {
"data": { "data": {
...@@ -1049,16 +1054,26 @@ ...@@ -1049,16 +1054,26 @@
"[1961 rows x 10 columns]" "[1961 rows x 10 columns]"
] ]
}, },
"execution_count": 13, "execution_count": 20,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
], ],
"source": [ "source": [
"raw_data = pd.read_csv(local_path, skiprows=1)\n", "\n",
"raw_data = pd.read_csv(data_file, skiprows=1)\n",
"raw_data" "raw_data"
] ]
}, },
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"local_path = 'incidence-PAY-3.csv'"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
......
# @source="rseau Sentinelles, INSERM, Sorbonne Universit, http://www.sentiweb.fr", @meta={"period":[198444,202221],"geo":["PAY","1"],"geo_ref":"insee","indicator":"3","type":"all","conf_int":true,"compact":false}, @date=2022-06-07T09:37:54+02:00 # @source="rseau Sentinelles, INSERM, Sorbonne Universit, http://www.sentiweb.fr", @meta={"period":[198444,202221],"geo":["PAY","1"],"geo_ref":"insee","indicator":"3","type":"all","conf_int":true,"compact":false}, @date=2022-06-07T10:39:55+02:00
week,indicator,inc,inc_low,inc_up,inc100,inc100_low,inc100_up,geo_insee,geo_name week,indicator,inc,inc_low,inc_up,inc100,inc100_low,inc100_up,geo_insee,geo_name
202221,3,17538,12255,22821,26,18,34,FR,France 202221,3,17538,12255,22821,26,18,34,FR,France
202220,3,20413,16271,24555,31,25,37,FR,France 202220,3,20413,16271,24555,31,25,37,FR,France
......
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