From 0c2eff1899d8118370442c8361319f1277946f64 Mon Sep 17 00:00:00 2001 From: 4951622f9f4ae8518bb995e4f0a0ce05 <4951622f9f4ae8518bb995e4f0a0ce05@app-learninglab.inria.fr> Date: Sun, 19 Oct 2025 10:33:19 +0000 Subject: [PATCH] =?UTF-8?q?Savoir=20faire=20un=20calcul=20simple=20soi-m?= =?UTF-8?q?=C3=AAme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module2/exo2/exercice.ipynb | 66 +++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/module2/exo2/exercice.ipynb b/module2/exo2/exercice.ipynb index 0bbbe37..ac5985b 100644 --- a/module2/exo2/exercice.ipynb +++ b/module2/exo2/exercice.ipynb @@ -1,5 +1,66 @@ { - "cells": [], + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "data = [\n", + "14.0, 9.7, 13.2, 12.5, 9.9, 14.9, 9.4, 16.9, 10.2, 14.9, 18.1, 7.3, 9.8,\n", + "12.1, 8.3, 11.4, 11.8, 14.6, 13.0, 14.8, 11.7, 10.7, 12.7, 12.9, 14.4, 13.3,\n", + "17.9, 9.2, 12.6, 18.4, 10.7, 19.0, 15.7, 14.9, 17.5, 13.9, 13.6, 16.5,\n", + "10.9, 14.7, 15.3, 12.9, 14.1, 12.5, 15.3, 16.1, 15.4, 16.2, 19.1, 17.4,\n", + "15.4, 15.9, 14.7, 16.9, 17.1, 18.2, 15.2, 16.4, 20.3, 23.7, 12.1,\n", + "15.4, 14.0, 8.3, 19.0, 21.0\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Moyenne : 14.331818181818182\n", + "Écart-type : 3.2901792839113986\n", + "Minimum : 7.3\n", + "Médiane : 14.649999999999999\n", + "Maximum : 23.7\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "print(\"Moyenne :\", np.mean(data))\n", + "print(\"Écart-type :\", np.std(data, ddof=1))\n", + "print(\"Minimum :\", np.min(data))\n", + "print(\"Médiane :\", np.median(data))\n", + "print(\"Maximum :\", np.max(data))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Calcul des statistiques descriptives\n", + "\n", + "On calcule ici la moyenne, l'écart-type, le minimum, la médiane et le maximum\n", + "de la série de données fournie, à l'aide de la bibliothèque *NumPy*.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], "metadata": { "kernelspec": { "display_name": "Python 3", @@ -16,10 +77,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.3" + "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 } - -- 2.18.1