From 479e6b5b4c10364d365e9126111a0be64fbc1ae4 Mon Sep 17 00:00:00 2001 From: 0c46a6992061d330dacd337aa0d1f077 <0c46a6992061d330dacd337aa0d1f077@app-learninglab.inria.fr> Date: Mon, 20 Apr 2020 17:41:12 +0000 Subject: [PATCH] second test jupyter --- module2/exo2/Module2 exo2.ipynb | 144 ++++++++++++++++++++++++++++++++ module2/exo2/exercice.ipynb | 25 ------ 2 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 module2/exo2/Module2 exo2.ipynb delete mode 100644 module2/exo2/exercice.ipynb diff --git a/module2/exo2/Module2 exo2.ipynb b/module2/exo2/Module2 exo2.ipynb new file mode 100644 index 0000000..0e569ba --- /dev/null +++ b/module2/exo2/Module2 exo2.ipynb @@ -0,0 +1,144 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Savoir faire un calcul simple soi-même\n", + "\n", + "Calculer la moyenne et l'écart-type, le min, la médiane et le max des données suivantes :" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "11.511917811136218" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import numpy as np\n", + "mu, sigma = 0.0, 1.0\n", + "x=np.random.normal(loc=11.5, scale=0.5, size=100)\n", + "abs(np.mean(x))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.0833216722028933" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "abs(np.std(x, ddof=1)) " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.734638689755644" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "abs(np.min(x))" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.9458688812984666" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "abs(np.max(x))" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "11.922677674564472" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "abs(np.median(x))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/module2/exo2/exercice.ipynb b/module2/exo2/exercice.ipynb deleted file mode 100644 index 0bbbe37..0000000 --- a/module2/exo2/exercice.ipynb +++ /dev/null @@ -1,25 +0,0 @@ -{ - "cells": [], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} - -- 2.18.1