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
d951b2bd8dd45f4f7d5db3d8deddfac2
mooc-rr
Commits
6487f6a1
Commit
6487f6a1
authored
Feb 02, 2026
by
d951b2bd8dd45f4f7d5db3d8deddfac2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use local CSV instead of downloading each time
parent
e391755a
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4430 additions
and
43 deletions
+4430
-43
toy_notebook_fr.ipynb
module2/exo1/toy_notebook_fr.ipynb
+122
-3
exercice.ipynb
module2/exo3/exercice.ipynb
+87
-3
Untitled.ipynb
module2/exo4/Untitled.ipynb
+6
-0
influenza-like-illness-analysis.ipynb
module3/exo1/influenza-like-illness-analysis.ipynb
+2061
-37
syndrome-grippal.csv
module3/exo1/syndrome-grippal.csv
+2154
-0
No files found.
module2/exo1/toy_notebook_fr.ipynb
View file @
6487f6a1
{
"cells": [],
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# À propos de pi"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The number $\\pi$ is defined as the ratio of a circle's circumference to its diameter.\n",
"\n",
"\\[\n",
"\\pi \\approx 3.141592653589793\n",
"\\]"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.141592653589793\n"
]
}
],
"source": [
"import math\n",
"print(math.pi)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A classical method to estimate $\\pi$ is\n",
"[Buffon's needle experiment](https://en.wikipedia.org/wiki/Buffon%27s_needle_problem)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.143863179074447\n"
]
}
],
"source": [
"import random\n",
"import math\n",
"\n",
"def buffon_pi(n=100000):\n",
" hits = 0\n",
" for _ in range(n):\n",
" y = random.random() / 2\n",
" theta = random.random() * math.pi / 2\n",
" if y <= 0.5 * math.sin(theta):\n",
" hits += 1\n",
" return (2 * n) / hits\n",
"\n",
"random.seed(1)\n",
"print(buffon_pi(50000))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"for _ in range(50):\n",
" x = random.random()\n",
" y = random.random()\n",
" theta = random.random() * math.pi\n",
" dx = 0.05 * math.cos(theta)\n",
" dy = 0.05 * math.sin(theta)\n",
" plt.plot([x-dx, x+dx], [y-dy, y+dy])\n",
"\n",
"plt.hlines([0.25, 0.75], 0, 1, linestyles=\"dashed\")\n",
"plt.axis(\"equal\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
...
...
@@ -16,10 +136,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.
3
"
"version": "3.6.
4
"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
module2/exo3/exercice.ipynb
View file @
6487f6a1
This diff is collapsed.
Click to expand it.
module2/exo4/Untitled.ipynb
0 → 100644
View file @
6487f6a1
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}
module3/exo1/influenza-like-illness-analysis.ipynb
View file @
6487f6a1
This diff is collapsed.
Click to expand it.
module3/exo1/syndrome-grippal.csv
0 → 100644
View file @
6487f6a1
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