337 lines
46 KiB
Plaintext
337 lines
46 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"# Etudes statistiques\n",
|
|||
|
"\n",
|
|||
|
"Dans ce TP, vous allez réaliser 2 études statistiques basées sur des données issues de l'INSEE ([L’Institut national de la statistique et des études économiques](https://www.insee.fr/fr/accueil))\n",
|
|||
|
"\n",
|
|||
|
"- [Températures moyennes entre 1900 et 2017](#Temperature)\n",
|
|||
|
"- [Population totale par sexe et âge au 1er janvier 2019, France](#Population)\n",
|
|||
|
"\n",
|
|||
|
"Vous trouverez en fin de TP, un [mémo sur les graphiques](#Graphiques)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## Temperature\n",
|
|||
|
"\n",
|
|||
|
"Voici les données des températures moyenne en France de 1900 à 2017 ([source](https://www.insee.fr/fr/statistiques/3676581?sommaire=3696937))"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"temperature = [\n",
|
|||
|
"12.14413, 11.11613, 11.18313, 11.48013, 11.93013, 11.22013, 11.75313, 11.44013,\n",
|
|||
|
"11.35113, 10.82313, 11.37413, 12.32013, 11.37913, 11.89413, 11.48813, 11.43513,\n",
|
|||
|
"11.59413, 10.57213, 11.64313, 11.09013, 11.83913, 12.42113, 11.11913, 11.71713,\n",
|
|||
|
"11.43513, 11.16313, 12.10113, 11.67313, 12.27613, 11.56013, 12.16513, 11.19613,\n",
|
|||
|
"11.54013, 11.59013, 12.20913, 11.72313, 11.77113, 12.28713, 11.73213, 11.51313,\n",
|
|||
|
"10.85413, 10.87613, 11.43513, 12.52613, 11.41213, 12.37413, 11.47213, 12.59313,\n",
|
|||
|
"12.11813, 12.62013, 12.03913, 11.69713, 11.85613, 11.85013, 11.34113, 11.84213,\n",
|
|||
|
"10.58113, 11.84313, 11.77313, 12.59413, 11.79813, 12.58413, 11.03513, 10.68313,\n",
|
|||
|
"11.71513, 11.29313, 12.02013, 11.92813, 11.59013, 11.57513, 11.66613, 11.57613,\n",
|
|||
|
"11.34313, 11.62213, 11.89313, 11.77913, 12.08513, 11.88713, 11.38613, 11.59513,\n",
|
|||
|
"11.16713, 11.91113, 12.63613, 12.36213, 11.61013, 11.34313, 11.64413, 11.65413,\n",
|
|||
|
"12.46513, 12.95013, 12.99913, 11.99113, 12.31813, 12.04713, 13.29813, 12.83713,\n",
|
|||
|
"11.85613, 13.12113, 12.53113, 12.99513, 13.12313, 12.76313, 13.14513, 13.48113,\n",
|
|||
|
"12.59113, 12.58813, 13.23913, 12.91113, 12.54513, 12.96413, 11.86613, 13.60113,\n",
|
|||
|
"12.79113, 12.38113, 13.72713, 13.512, 13, 13.4\n",
|
|||
|
"]"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Pour toutes les questions suivantes, les réponses doivent être données par votre programme.\n",
|
|||
|
"\n",
|
|||
|
"1. Décrire la série statistique (population, individus, caractère)\n",
|
|||
|
"2. Quelle a été la température en 1900, 1918, 1945, 1990 et en 2000?\n",
|
|||
|
"3. Calculer les 5 indicateurs et donner une interprétation de chacun de ces indicateurs.\n",
|
|||
|
"4. Tracer la courbe d'évolution des températures.\n",
|
|||
|
"\n",
|
|||
|
"Vous pouvez utiliser la commande suivante pour générer les années."
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 4,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"annee = list(range(1900, 2018))"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"# Population\n",
|
|||
|
"\n",
|
|||
|
"Voici l'estimation de la population totale par sexe et âge au 1er janvier 2019. Chaque élément de la liste correspond à une tranche d'age.\n",
|
|||
|
"\n",
|
|||
|
"- le premier élément (347749 pour les femmes) correspond au nombre de personnes ayant 0 an (nés en 2018)\n",
|
|||
|
"- le deuxime élément (370453 pour les hommes) correspond au nombre de personnes ayant 1 an (nés en 2019)\n",
|
|||
|
"- le dernier élément correspon au nombre de personnes ayant plus de 100ans (nés avant 1918)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"femmes = [\n",
|
|||
|
"347749, 355472, 363162, 372402, 387042, 389920, 396835, 403349, 412555, 408232,\n",
|
|||
|
"410703, 408166, 415280, 405218, 403761, 402532, 403441, 409037, 412560, 390002,\n",
|
|||
|
"384532, 370258, 374177, 367951, 358614, 357966, 376224, 385366, 397080, 405038,\n",
|
|||
|
"409842, 413955, 422167, 420790, 417815, 414133, 438390, 442482, 448307, 424441,\n",
|
|||
|
"414208, 413671, 404350, 413722, 435157, 460384, 469527, 466462, 457896, 452879,\n",
|
|||
|
"450472, 447421, 457665, 459310, 464153, 460412, 445047, 444896, 444709, 442263,\n",
|
|||
|
"433635, 430912, 427893, 424094, 421875, 413428, 418007, 408050, 422019, 413673,\n",
|
|||
|
"409072, 400876, 378561, 286325, 279055, 269401, 249057, 221914, 231318, 239598,\n",
|
|||
|
"232663, 226088, 222853, 213902, 210980, 195596, 192550, 175872, 164803, 139226,\n",
|
|||
|
"124322, 105456, 91072, 76447, 61235, 48398, 37882, 27754, 19813, 8273, 12670\n",
|
|||
|
"]\n",
|
|||
|
"hommes = [\n",
|
|||
|
"364155, 370453, 378518, 387906, 399232, 407611, 417471, 418623,\n",
|
|||
|
"429919, 427917, 430934, 426744, 433073, 424141, 422877, 422127,\n",
|
|||
|
"423901, 431086, 433377, 410714, 398993, 384384, 381869, 371731,\n",
|
|||
|
"357849, 356195, 373660, 377772, 384835, 385034, 390899, 392786,\n",
|
|||
|
"397979, 398786, 396435, 391214, 416777, 421707, 427643, 405581,\n",
|
|||
|
"399149, 404816, 390441, 404346, 426173, 448213, 459886, 457822,\n",
|
|||
|
"448697, 441572, 434971, 432749, 441979, 442828, 444960, 438142,\n",
|
|||
|
"422099, 421161, 416331, 410415, 400042, 395817, 390345, 382395,\n",
|
|||
|
"381146, 371165, 374781, 364694, 374817, 364312, 361485, 350179,\n",
|
|||
|
"327085, 242793, 234112, 224687, 204674, 177799, 179151, 182015,\n",
|
|||
|
"171854, 160969, 153145, 139041, 131872, 116712, 108339, 95104,\n",
|
|||
|
"83373, 66602, 55382, 44797, 34519, 27317, 20525, 14477, 10101, \n",
|
|||
|
"7239, 4977, 2058, 2976\n",
|
|||
|
"]"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"1. Décrire les séries statistiques (population, individues, caractères)\n",
|
|||
|
"\n",
|
|||
|
"2. Combien y a-t-il d'homme en tout? De femmes? De personnes?\n",
|
|||
|
"\n",
|
|||
|
"3. Sur un même graphique tracer la répartition en fonction de l'age de la population féminine et masculine.\n",
|
|||
|
"\n",
|
|||
|
"4. Pour comparer la **répartition** de la population les **quantités** ne sont pas adapté, on préfèrera la **fréquence** (effectif divisé par l'effectif total). Créer 2 autres listes pour calculer la fréquence de chaque classe d'age pour les hommes et les femmes. Tracer à nouveau la répartition selon les ages.\n",
|
|||
|
"\n",
|
|||
|
"5. Calculer les 5 indicateurs pour les 2 séries. Interpréter."
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"# Graphiques\n",
|
|||
|
"\n",
|
|||
|
"Pour tracer des graphiques, on utilisera la librairie Maplotlib."
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 10,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Pour tracer une courbe"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 27,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAeu0lEQVR4nO3da3Bcd5nn8e+juy+ypLbku6VuO87FCUlsS22bAJNNIIRMNmEyYXNZnMvCmoVhBtjZoshMFczyapjdYmeZUGRSwEISYBMCAyFDimIhA8NufFPsOE4cBwdJlmwnvrQutiVZU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GycF4pycT87Bh4PMaqBepAkZlNgS7TSm9/ml2tHYMdKI0t7XT3ZTtQEtVzuGX1wmyIx2Msj6kDRWQoBbrkVVdvP40t7YN3ot/d1klfOoMZXLGwnI+sW0ZDcAa+YF5ZvssVmdYU6DKljp08zfam1OCNjPce7iLjUFRgvGtZBQ+/J04yHqO+LkbFbHWgiFwMBbpMqrb27rOX0Den+MPRbAdKWXEBa2ur+IubV5GMx1hTW8WsEnWgiFwKBbrkjLvz1rAOlEOd2Q6UeWVFNMRj3FO/nIZEjGuWVFBSpA4UkVxSoMuEDaQz7D18gq1NxwfnQEmd6gNgQXkpDYkY/ym4AvOKheXqQBGZZAp0Gbfe/jS72zoHr8BsbE5xKuhAqZs/m5uuXDDYQlg3f7Y6UESmmAJdRnXy9EDQgXKc7U3t7GrtoC+dvY3aFQvLuWvtssF5UBaqA0Uk7xToMuj4ydNsbz47C+FrhzrJOBQWGNcsreChG+I0xGM0xKuonF2S73JFZBgF+gx2sKPnnBb
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# le graphique\n",
|
|||
|
"fig, ax = plt.subplots()\n",
|
|||
|
"# Abscisses\n",
|
|||
|
"x = [10, 100, 1000, 10000]\n",
|
|||
|
"# Ordonnées\n",
|
|||
|
"y = [1, 2, 3, 4]\n",
|
|||
|
"# On ajoute la courbe\n",
|
|||
|
"ax.plot(x, y)\n",
|
|||
|
"# On affiche\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Pour mettre plusieurs courbes sur le même graphique"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"exec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HnHrE6CiEExvydH689wDsrUjlVUMTN0eE8cXVXIpq67/ydrsi+CV26XISwXIlD89XGDF5btouMk2e4rKsxf2fPtu4/f6crsm9Cly4XISyjtebnXVlMXZJM8pHT9G0Xwiuj+zKks+fM3+mKbJ7QpcpFiIa2Oe0k/1qyk9/2ZtO+WRDv3NGfkb3byOBZLsC+CV26XIRoUPuO5fHq0hS+23qYZsF+vDCqF2PjIvHzkRJEV2HfhO4bBCVnwVECXlIKJUR9yTp9lrd+2s3cdQfx8/HisSu7MOnSjjTy8Pk7XZF9r0j5MdH9ZQwIIZwt92wx01fuZcaqvRQWO7h9YCSPXinzd7oy+yb0c0PoSkIXwpkKix3MXXeQt37azfG8Qq435+/sIPN3ujz7JnSZtUgIp3I4NN9tPcyrP6Rw4Hg+gzs2ZdZ1PWT+ThuRhC6EYE3qMV76Ppkt6Tl0b92YD8fHMbxrCxk8y2bsm9BLJ4qWWnQhLtqOQ6eY+n0yv+zKIjw0kNfG9GNUdDjeUoJoS/ZN6L6Bxr8yJroQFywtO5/Xlu3iq00ZhATK/J3uwsYJXbpchLhQJ/IKeWdFKh+vPYBScP9lnbj/sk6EBMr8ne7Avgn9XJeLJHQhanKmsIRZq/cx7ec95BUWc2tMBI9f3YU2IYFWhyacyL4J/VyXiyR0IapTXOJgQVI6r/+4i6OnznJVD2P+zi6tpNTXHdk4oUsLXYjqaK1ZtuMoLy9NITUzl5j2YbxzxwDiZP5Ot2bfhO4nfehCVCVxfzYvLUkm8cAJOrUI5oO7YrhG5u/0CPZN6D4BgJIuFyFMqZnG/J3LdhylZWN//vXHPtwq83d6FPsmdKXMIXQloQvPdiSngDd+3MW8xDSC/Xz487XduG+ozN/
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# le graphique\n",
|
|||
|
"fig, ax = plt.subplots()\n",
|
|||
|
"# Abscisses\n",
|
|||
|
"x = [1000, 3000, 6000, 10000]\n",
|
|||
|
"# Ordonnées\n",
|
|||
|
"y = [1, 2, 3, 4]\n",
|
|||
|
"# On ajoute la courbe\n",
|
|||
|
"ax.plot(x, y)\n",
|
|||
|
"# On ajoute une autre courbe\n",
|
|||
|
"x = [10, 100, 1000, 10000]\n",
|
|||
|
"y2 = [4, 3, 2, 1]\n",
|
|||
|
"ax.plot(x, y2)\n",
|
|||
|
"# On affiche\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Pour faire des barres"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 35,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEICAYAAABS0fM3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbmUlEQVR4nO3deZhU9Z3v8ffHZo24RGiX0GwuMUbARtHgkoxb4parE6MTvI67QyZGJ96smuvKkzsuuZE7hpkYR4y4jHEiiaIxihMxRhMloIAC8tBqjzQhgCgoigvyvX+cAynKaqoa+lR19fm8nqeePsvvnPP99faps9Q5igjMzCy/tql1AWZmVlsOAjOznHMQmJnlnIPAzCznHARmZjnnIDAzyzkHgZlZzjkILHckrZG0ewXt+kp6StIJ1airnRq+JmlZWnN/SYdKWpSO/20nbmdwus6GdHwXSU9IekvSjzprO9Y1OQgsc5LOlvS8pHck/UXSv0naoUrbflzS+YXTIqJfRLyczr9N0g/aWfynwA0R8est3Pbhktq2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ra2sstsv/32QHLDurVr15Z9vvCGO5sC7Lvvvqxdu5b33ntvkxvidQbvEZiZbaVJkyZx3HHHVdT2nHPOYdddd+XFF1/koosuqngbU6ZMYf/99+/0EAAHgZnZVpk+fTqTJk3iuuuKH7dS2s9+9jP+/Oc/s88++3DPPfdUtMy8efP43ve+x09/+tOtKbVdDgIzsy00d+5czj//fO6//3769//I49bb1dDQwNixY5kyZUrZtm1tbXzpS1/i9ttvZ4899tiactvlcwR
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# le graphique\n",
|
|||
|
"fig, ax = plt.subplots()\n",
|
|||
|
"# Abscisses\n",
|
|||
|
"x = [10, 30, 50, 70]\n",
|
|||
|
"# Ordonnées\n",
|
|||
|
"y = [1, 2, 3, 2]\n",
|
|||
|
"# On ajoute la courbe\n",
|
|||
|
"ax.bar(x, y, label=y)\n",
|
|||
|
"# Une legende\n",
|
|||
|
"ax.legend(title='Panier')\n",
|
|||
|
"# Nom de l'axe des y\n",
|
|||
|
"ax.set_ylabel('Effectif')\n",
|
|||
|
"# Titre du graphique\n",
|
|||
|
"ax.set_title('Quantité et effectifs')\n",
|
|||
|
"# Afficher le graphique\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
}
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"kernelspec": {
|
|||
|
"display_name": "Python 3 (ipykernel)",
|
|||
|
"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.10.10"
|
|||
|
}
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 2
|
|||
|
}
|