Module 3, exo 1: télécharge si pas présetn

parent 87a21bbe
......@@ -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": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7ff623d59b00>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc07d183390>"
]
},
"execution_count": 9,
......@@ -2247,7 +2253,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7ff621bb39b0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc07c7044a8>"
]
},
"execution_count": 10,
......@@ -2351,7 +2357,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7ff621b4d390>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc07c69f438>"
]
},
"execution_count": 13,
......@@ -2453,7 +2459,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7ff621b2a0f0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fc07c67db70>"
]
},
"execution_count": 15,
......
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