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
86d2379a8cd828206f6e8576c862739f
mooc-rr
Commits
e9f312f1
Commit
e9f312f1
authored
Aug 28, 2020
by
86d2379a8cd828206f6e8576c862739f
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no commit message
parent
2a331190
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
exercice.ipynb
module3/exo3/exercice.ipynb
+41
-3
No files found.
module3/exo3/exercice.ipynb
View file @
e9f312f1
...
@@ -728,10 +728,48 @@
...
@@ -728,10 +728,48 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
32
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
"source": []
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-32-15a64fef2e76>, line 8)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-32-15a64fef2e76>\"\u001b[0;36m, line \u001b[0;32m8\u001b[0m\n\u001b[0;31m print form.format(*val)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [
"alive = [\"nb vivantes\", len(data[(data['Smoker'] == \"Yes\") & (data['Status'] == \"Alive\")].index), len(data[(data['Smoker'] == \"No\") & (data['Status'] == \"Alive\")].index)]\n",
"dead = [\"nb mortes\", len(data[(data['Smoker'] == \"Yes\") & (data['Status'] == \"Dead\")].index), len(data[(data['Smoker'] == \"No\") & (data['Status'] == \"Dead\")].index)]\n",
"deathrate = [\"taux mortalite\", dead[1]/(alive[1] + dead[1]), dead[2]/(alive[2] + dead[2])]\n",
"\n",
"tab = [[\"\", \"Smokers\", \"Non Smokers\"], alive, dead, deathrate]\n",
"form=\"{0:10}{1:10}{2:10}\"\n",
"for val in tab:\n",
" print form.format(*val)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"443"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(data[(data['Smoker'] == \"Yes\") & (data['Status'] == \"Alive\")].index)"
]
}
}
],
],
"metadata": {
"metadata": {
...
...
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