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
9ff7eb902e8f0358b234efe9f0500594
mooc-rr
Commits
102d2873
Commit
102d2873
authored
Apr 16, 2024
by
9ff7eb902e8f0358b234efe9f0500594
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modification d'un element
parent
5c2b6687
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
131 additions
and
17 deletions
+131
-17
exercice_fr.ipynb
module3/exo3/exercice_fr.ipynb
+131
-17
No files found.
module3/exo3/exercice_fr.ipynb
View file @
102d2873
...
@@ -592,31 +592,145 @@
...
@@ -592,31 +592,145 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
89
,
"execution_count":
105
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"data": {
"output_type": "stream",
"text/html": [
"text": [
"<div>\n",
" Date Concentration Annee Moyenne\n",
"<style scoped>\n",
"0 1958-03-29 316.19 1958 315.474\n",
" .dataframe tbody tr th:only-of-type {\n",
"1 1958-04-05 317.31 1958 315.474\n",
" vertical-align: middle;\n",
"2 1958-04-12 317.69 1958 315.474\n",
" }\n",
"3 1958-04-19 317.58 1958 315.474\n",
"\n",
"4 1958-04-26 316.48 1958 315.474\n",
" .dataframe tbody tr th {\n",
"5 1958-05-03 316.95 1958 315.474\n",
" vertical-align: top;\n",
"6 1958-05-17 317.56 1958 315.474\n",
" }\n",
"7 1958-05-24 317.99 1958 315.474\n",
"\n",
"8 1958-07-05 315.85 1958 315.474\n",
" .dataframe thead th {\n",
"9 1958-07-12 315.85 1958 315.474\n"
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Date</th>\n",
" <th>Concentration</th>\n",
" <th>Annee</th>\n",
" <th>Moyenne</th>\n",
" <th>Oscilation</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1958-03-29</td>\n",
" <td>316.19</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>0.716</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1958-04-05</td>\n",
" <td>317.31</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>1.836</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1958-04-12</td>\n",
" <td>317.69</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>2.216</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1958-04-19</td>\n",
" <td>317.58</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>2.106</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1958-04-26</td>\n",
" <td>316.48</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>1.006</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>1958-05-03</td>\n",
" <td>316.95</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>1.476</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>1958-05-17</td>\n",
" <td>317.56</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>2.086</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>1958-05-24</td>\n",
" <td>317.99</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>2.516</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>1958-07-05</td>\n",
" <td>315.85</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>0.376</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>1958-07-12</td>\n",
" <td>315.85</td>\n",
" <td>1958</td>\n",
" <td>315.474</td>\n",
" <td>0.376</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Date Concentration Annee Moyenne Oscilation\n",
"0 1958-03-29 316.19 1958 315.474 0.716\n",
"1 1958-04-05 317.31 1958 315.474 1.836\n",
"2 1958-04-12 317.69 1958 315.474 2.216\n",
"3 1958-04-19 317.58 1958 315.474 2.106\n",
"4 1958-04-26 316.48 1958 315.474 1.006\n",
"5 1958-05-03 316.95 1958 315.474 1.476\n",
"6 1958-05-17 317.56 1958 315.474 2.086\n",
"7 1958-05-24 317.99 1958 315.474 2.516\n",
"8 1958-07-05 315.85 1958 315.474 0.376\n",
"9 1958-07-12 315.85 1958 315.474 0.376"
]
]
},
"execution_count": 105,
"metadata": {},
"output_type": "execute_result"
}
}
],
],
"source": [
"source": [
"raw_data['Moyenne'] = raw_data.groupby('Annee')['Concentration'].transform('mean')\n",
"raw_data['Moyenne'] = raw_data.groupby('Annee')['Concentration'].transform('mean')\n",
"# Affichons les 10 premières lignes\n",
"# Affichons les 10 premières lignes\n",
"
print(raw_data.head(10)
)"
"
raw_data.head(10
)"
]
]
},
},
{
{
...
...
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