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
521adc37f04e8509ebf5ce131815aa0a
mooc-rr
Commits
1caeff93
Commit
1caeff93
authored
Feb 06, 2021
by
521adc37f04e8509ebf5ce131815aa0a
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Définir une fonction de conversion year/week pour toutes les lignes
parent
2654341b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
exercice.ipynb
module3/exo2/exercice.ipynb
+44
-1
No files found.
module3/exo2/exercice.ipynb
View file @
1caeff93
...
...
@@ -2062,7 +2062,7 @@
},
{
"cell_type": "code",
"execution_count": 1
2
,
"execution_count": 1
3
,
"metadata": {},
"outputs": [
{
...
...
@@ -2083,6 +2083,49 @@
"print(w.day(0))"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Period('1984-10-29/1984-11-04', 'W-SUN')"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.Period(w.day(0), \"w\")"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"# Définir une fonction pour chaque ligne des jeux de données\n",
"\n",
"def convert_week(year_and_week_int):\n",
" year_and_week_str = str(year_and_week_int)\n",
" year = int(year_and_week_str[:4])\n",
" week = int(year_and_week_str[4:])\n",
" w = isoweek.Week(year, week)\n",
" return pd.Period(w.day(0), \"w\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
...
...
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