Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
de005631c87798887a112e0e26e250dc
mooc-rr
Commits
5e390cf1
Commit
5e390cf1
authored
Apr 02, 2020
by
de005631c87798887a112e0e26e250dc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accès en local si le fichier existe sinon accès à distance et création d'une copie locale
parent
e306ac2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1903 additions
and
3 deletions
+1903
-3
analyse-syndrome-grippal.ipynb
module3/exo1/analyse-syndrome-grippal.ipynb
+55
-3
incidence-PAY-3.csv
module3/exo1/incidence-PAY-3.csv
+1848
-0
No files found.
module3/exo1/analyse-syndrome-grippal.ipynb
View file @
5e390cf1
...
@@ -59,7 +59,60 @@
...
@@ -59,7 +59,60 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 3,
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'incidence-PAY-3.csv'"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Récupération du nom du fichier à partir du path d'accès aux données\n",
"from os.path import basename\n",
"\n",
"filename = basename(data_url)\n",
"filename"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"incidence-PAY-3.csv doesn't exist\n"
]
}
],
"source": [
"# Si le fichier existe en local on le lit directement\n",
"# Sinon on l'accède avec son URL et on le sauvegarde en local\n",
"\n",
"# La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant skiprows=1.\n",
"import os\n",
"\n",
"if os.path.exists(filename):\n",
" print(filename, \"exist\")\n",
" raw_data = pd.read_csv(filename, skiprows=1)\n",
"else:\n",
" print(filename, \"doesn't exist\")\n",
" raw_data = pd.read_csv(data_url, skiprows=1)\n",
" raw_data.to_csv(filename)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -1024,13 +1077,12 @@
...
@@ -1024,13 +1077,12 @@
"[1847 rows x 10 columns]"
"[1847 rows x 10 columns]"
]
]
},
},
"execution_count":
3
,
"execution_count":
19
,
"metadata": {},
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result"
}
}
],
],
"source": [
"source": [
"raw_data = pd.read_csv(data_url, skiprows=1)\n",
"raw_data"
"raw_data"
]
]
},
},
...
...
module3/exo1/incidence-PAY-3.csv
0 → 100644
View file @
5e390cf1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment