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
e436212dbb67ba8b493d344beb7f7acb
mooc-rr
Commits
588dc437
Commit
588dc437
authored
May 31, 2023
by
e436212dbb67ba8b493d344beb7f7acb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct august in september
parent
11e5c216
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
50 deletions
+44
-50
exercice.ipynb
module3/exo2/exercice.ipynb
+44
-50
No files found.
module3/exo2/exercice.ipynb
View file @
588dc437
...
...
@@ -1319,11 +1319,11 @@
},
{
"cell_type": "code",
"execution_count":
14
,
"execution_count":
20
,
"metadata": {},
"outputs": [],
"source": [
"first_
augus
t_week = [pd.Period(pd.Timestamp(y, 9, 1), 'W')\n",
"first_
sep
t_week = [pd.Period(pd.Timestamp(y, 9, 1), 'W')\n",
" for y in range(1991,\n",
" sorted_data.index[-1].year)]"
]
...
...
@@ -1339,14 +1339,14 @@
},
{
"cell_type": "code",
"execution_count":
15
,
"execution_count":
21
,
"metadata": {},
"outputs": [],
"source": [
"year = []\n",
"yearly_incidence = []\n",
"for week1, week2 in zip(first_
augus
t_week[:-1],\n",
" first_
augus
t_week[1:]):\n",
"for week1, week2 in zip(first_
sep
t_week[:-1],\n",
" first_
sep
t_week[1:]):\n",
" one_year = sorted_data['inc'][week1:week2-1]\n",
" assert abs(len(one_year)-52) < 2\n",
" yearly_incidence.append(one_year.sum())\n",
...
...
@@ -1363,16 +1363,16 @@
},
{
"cell_type": "code",
"execution_count":
16
,
"execution_count":
22
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fea5d
54840
0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fea5d
44dc5
0>"
]
},
"execution_count":
16
,
"execution_count":
22
,
"metadata": {},
"output_type": "execute_result"
},
...
...
@@ -1402,53 +1402,47 @@
},
{
"cell_type": "code",
"execution_count":
16
,
"execution_count":
23
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2021 743449\n",
"2014 1600941\n",
"1991 1659249\n",
"1995 1840410\n",
"2020 2010315\n",
"2022 2060304\n",
"2012 2175217\n",
"2003 2234584\n",
"2019 2254386\n",
"2006 2307352\n",
"2017 2321583\n",
"2001 2529279\n",
"1992 2574578\n",
"1993 2703886\n",
"2018 2705325\n",
"1988 2765617\n",
"2007 2780164\n",
"1987 2855570\n",
"2016 2856393\n",
"2011 2857040\n",
"2008 2973918\n",
"1998 3034904\n",
"2002 3125418\n",
"2009 3444020\n",
"1994 3514763\n",
"1996 3539413\n",
"2004 3567744\n",
"1997 3620066\n",
"2015 3654892\n",
"2000 3826372\n",
"2005 3835025\n",
"1999 3908112\n",
"2010 4111392\n",
"2013 4182691\n",
"1986 5115251\n",
"1990 5235827\n",
"1989 5466192\n",
"2020 221186\n",
"2021 376290\n",
"2002 516689\n",
"2018 542312\n",
"2017 551041\n",
"1996 564901\n",
"2019 584066\n",
"2015 604382\n",
"2000 617597\n",
"2001 619041\n",
"2012 624573\n",
"2005 628464\n",
"2006 632833\n",
"2022 641397\n",
"2011 642368\n",
"1993 643387\n",
"1995 652478\n",
"1994 661409\n",
"1998 677775\n",
"1997 683434\n",
"2014 685769\n",
"2013 698332\n",
"2007 717352\n",
"2008 749478\n",
"1999 756456\n",
"2003 758363\n",
"2004 777388\n",
"2016 782114\n",
"2010 829911\n",
"1992 832939\n",
"2009 842373\n",
"dtype: int64"
]
},
"execution_count":
16
,
"execution_count":
23
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -1466,16 +1460,16 @@
},
{
"cell_type": "code",
"execution_count":
18
,
"execution_count":
24
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fea5d
47bb0
0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7fea5d
381f6
0>"
]
},
"execution_count":
18
,
"execution_count":
24
,
"metadata": {},
"output_type": "execute_result"
},
...
...
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