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
1071ae964b205fc96951cf272887f050
mooc-rr
Commits
f757ca65
Commit
f757ca65
authored
Jun 21, 2025
by
1071ae964b205fc96951cf272887f050
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task finished
parent
be360c7b
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4281 additions
and
13 deletions
+4281
-13
influenza-like-illness-analysis.ipynb
module3/exo1/influenza-like-illness-analysis.ipynb
+37
-13
local_data.csv
module3/exo1/local_data.csv
+2122
-0
local_data_for_this_task.csv
module3/exo1/local_data_for_this_task.csv
+2122
-0
No files found.
module3/exo1/influenza-like-illness-analysis.ipynb
View file @
f757ca65
...
@@ -9,10 +9,8 @@
...
@@ -9,10 +9,8 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {
"metadata": {},
"collapsed": true
},
"outputs": [],
"outputs": [],
"source": [
"source": [
"%matplotlib inline\n",
"%matplotlib inline\n",
...
@@ -29,14 +27,28 @@
...
@@ -29,14 +27,28 @@
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "markdown",
"execution_count": null,
"metadata": {},
"metadata": {
"source": [
"collapsed": true
"I modified this computational document such that it uses a local copy of the data. If the local file does not exist, download the data and put them into the local file. And then read the local CSV file."
]
},
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
"data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\""
"import os\n",
"import urllib.request\n",
"\n",
"local_file_for_this_task = \"local_data.csv\"\n",
"data_url = \"http://www.sentiweb.fr/datasets/incidence-PAY-3.csv\"\n",
"\n",
"if not os.path.exists(local_file_for_this_task):\n",
" urllib.request.urlretrieve(data_url, local_file_for_this_task)\n",
"else:\n",
" pass"
]
]
},
},
{
{
...
@@ -63,11 +75,23 @@
...
@@ -63,11 +75,23 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
4
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'pd' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-7c69161e8105>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mraw_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlocal_file_for_this_task\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mskiprows\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mraw_data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'pd' is not defined"
]
}
],
"source": [
"source": [
"raw_data = pd.read_csv(
data_url
, skiprows=1)\n",
"raw_data = pd.read_csv(
local_file_for_this_task
, skiprows=1)\n",
"raw_data"
"raw_data"
]
]
},
},
...
@@ -365,7 +389,7 @@
...
@@ -365,7 +389,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.6.
1
"
"version": "3.6.
4
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
module3/exo1/local_data.csv
0 → 100644
View file @
f757ca65
This diff is collapsed.
Click to expand it.
module3/exo1/local_data_for_this_task.csv
0 → 100644
View file @
f757ca65
This diff is collapsed.
Click to expand it.
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