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
c4b4c4d45a79e9781c87897476ed95c8
mooc-rr
Commits
7e2680b8
Commit
7e2680b8
authored
May 12, 2020
by
c4b4c4d45a79e9781c87897476ed95c8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exo 2 Updates before checking the solution
parent
db8b0c5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
toy_notebook_fr.ipynb
module2/exo1/toy_notebook_fr.ipynb
+30
-22
No files found.
module2/exo1/toy_notebook_fr.ipynb
View file @
7e2680b8
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
4
,
"execution_count":
1
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
}
}
],
],
"source": [
"source": [
"
In [1]:
from math import *\n",
"from math import *\n",
"print(pi)"
"print(pi)"
]
]
},
},
...
@@ -57,16 +57,18 @@
...
@@ -57,16 +57,18 @@
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
"ename": "SyntaxError",
"data": {
"evalue": "invalid syntax (<ipython-input-2-f24264f0d041>, line 5)",
"text/plain": [
"output_type": "error",
"3.128911138923655"
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-2-f24264f0d041>\"\u001b[0;36m, line \u001b[0;32m5\u001b[0m\n\u001b[0;31m theta = np.random.uniform(size=N, low=0, high=%pi/2)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
}
],
],
"source": [
"source": [
"
In [2]:
import numpy as np\n",
"import numpy as np\n",
"np.random.seed(seed=42)\n",
"np.random.seed(seed=42)\n",
"N = 10000\n",
"N = 10000\n",
"x = np.random.uniform(size=N, low=0, high=1) \n",
"x = np.random.uniform(size=N, low=0, high=1) \n",
...
@@ -85,7 +87,7 @@
...
@@ -85,7 +87,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
9
,
"execution_count":
3
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -102,7 +104,7 @@
...
@@ -102,7 +104,7 @@
}
}
],
],
"source": [
"source": [
"
In [3]:
%matplotlib inline\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.pyplot as plt\n",
" \n",
" \n",
"np.random.seed(seed=42)\n",
"np.random.seed(seed=42)\n",
...
@@ -127,19 +129,25 @@
...
@@ -127,19 +129,25 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"metadata": {
"outputs": [],
"scrolled": true
"source": [
"In [4] : 4*np.mean(accept)"
]
},
},
"outputs": [
{
{
"cell_type": "code",
"data": {
"execution_count": null,
"text/plain": [
"3.112"
]
},
"execution_count": 4,
"metadata": {},
"metadata": {},
"outputs": [],
"output_type": "execute_result"
"source": []
}
],
"source": [
"4*np.mean(accept)"
]
}
}
],
],
"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