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
8c82b2701c130ec4af8160ecac35027a
mooc-rr
Commits
10b8c53f
Commit
10b8c53f
authored
Jun 04, 2025
by
8c82b2701c130ec4af8160ecac35027a
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added coditional local load
parent
a5ee52a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2209 additions
and
20 deletions
+2209
-20
analyse-syndrome-grippal.ipynb
module3/exo1/analyse-syndrome-grippal.ipynb
+90
-20
my_csv.csv
module3/exo1/my_csv.csv
+2119
-0
No files found.
module3/exo1/analyse-syndrome-grippal.ipynb
View file @
10b8c53f
...
...
@@ -57,10 +57,84 @@
"La première ligne du fichier CSV est un commentaire, que nous ignorons en précisant `skiprows=1`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we save the freshly downlaoded csv file for better persistence, though we first test if we didn't do that previously.\n",
"The file will be saved in the current folder:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/jovyan/work/module3/exo1'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os\n",
"os.getcwd()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"analyse-syndrome-grippal.ipynb\t influenza-like-illness-analysis.org\r\n",
"analyse-syndrome-grippal.org\t influenza-like-illness-analysis.Rmd\r\n",
"analyse-syndrome-grippal.Rmd\t my_csv.csv\r\n",
"influenza-like-illness-analysis.ipynb\r\n"
]
}
],
"source": [
"!ls /home/jovyan/work/module3/exo1"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File exists, just loaded it !\n"
]
}
],
"source": [
"# if file does not exist, download and save\n",
"if not os.path.isfile(os.path.join('/home/jovyan/work/module3/exo1', 'my_csv.csv')):\n",
" print(\"File has been downloaded !\")\n",
" raw_data = pd.read_csv(data_url, skiprows=1)\n",
" raw_data.to_csv(os.path.join('/home/jovyan/work/module3/exo1', 'my_csv.csv'), index=False)\n",
"# if it exists just laod\n",
"else:\n",
" print(\"File exists, just loaded it !\")\n",
" raw_data = pd.read_csv(os.path.join('/home/jovyan/work/module3/exo1', 'my_csv.csv'))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
...
...
@@ -1024,13 +1098,12 @@
"[2118 rows x 10 columns]"
]
},
"execution_count":
3
,
"execution_count":
10
,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw_data = pd.read_csv(data_url, skiprows=1)\n",
"raw_data"
]
},
...
...
@@ -1043,7 +1116,7 @@
},
{
"cell_type": "code",
"execution_count":
4
,
"execution_count":
28
,
"metadata": {},
"outputs": [
{
...
...
@@ -1067,21 +1140,21 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>
week
</th>\n",
" <th>
indicator
</th>\n",
" <th>
inc
</th>\n",
" <th>
inc_low
</th>\n",
" <th>
inc_up
</th>\n",
" <th>
inc100
</th>\n",
" <th>
inc100_low
</th>\n",
" <th>
inc100_up
</th>\n",
" <th>
geo_insee
</th>\n",
" <th>
geo_nam
e</th>\n",
" <th>
202522
</th>\n",
" <th>
3
</th>\n",
" <th>
20831
</th>\n",
" <th>
15052.0
</th>\n",
" <th>
26610.0
</th>\n",
" <th>
31
</th>\n",
" <th>
22.0
</th>\n",
" <th>
40.0
</th>\n",
" <th>
FR
</th>\n",
" <th>
Franc
e</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>188
1
</th>\n",
" <th>188
0
</th>\n",
" <td>198919</td>\n",
" <td>3</td>\n",
" <td>-</td>\n",
...
...
@@ -1098,14 +1171,11 @@
"</div>"
],
"text/plain": [
" week indicator inc inc_low inc_up inc100 inc100_low inc100_up \\\n",
"1881 198919 3 - NaN NaN - NaN NaN \n",
"\n",
" geo_insee geo_name \n",
"1881 FR France "
" 202522 3 20831 15052.0 26610.0 31 22.0 40.0 FR France\n",
"1880 198919 3 - NaN NaN - NaN NaN FR France"
]
},
"execution_count":
4
,
"execution_count":
28
,
"metadata": {},
"output_type": "execute_result"
}
...
...
module3/exo1/my_csv.csv
0 → 100644
View file @
10b8c53f
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