From 09b1eb355b05c6f5290fd783badbab20d5ef90d9 Mon Sep 17 00:00:00 2001 From: 2207ee6c4b0763c29ab8f98156e3343c <2207ee6c4b0763c29ab8f98156e3343c@app-learninglab.inria.fr> Date: Thu, 15 Jul 2021 20:11:58 +0000 Subject: [PATCH] as --- module2/exo1/toy_notebook_fr.ipynb | 33 ++++++++++++------------------ 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 9f48513..35fcc9c 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -78,26 +78,7 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib inline\n", - "import matplotlib.pyplot as plt\n", - "\n", - "\n", - "np.random.seed(seed=42)\n", - "N=1000\n", - "x = np.random.uniform(size=N, low=0, high=1)\n", - "y = np.random.uniform(size=N, low=0, high=1)\n", - "\n", - "accept = (x*x+y*y) <= 1\n", - "reject = np.logical_not(accept)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 10, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -114,6 +95,18 @@ } ], "source": [ + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "\n", + "\n", + "np.random.seed(seed=42)\n", + "N=1000\n", + "x = np.random.uniform(size=N, low=0, high=1)\n", + "y = np.random.uniform(size=N, low=0, high=1)\n", + "\n", + "accept = (x*x+y*y) <= 1\n", + "reject = np.logical_not(accept)\n", + "\n", "fig, ax = plt.subplots(1)\n", "ax.scatter(x[accept], y[accept], c='b', alpha=0.2, edgecolor=None)\n", "ax.scatter(x[reject], y[reject], c='r', alpha=0.2, edgecolor=None)\n", -- 2.18.1