Savoir faire un calcul simple soi-même

parent 9f681f7b
{
"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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment