2018-2019/PreStSauveur/Programmation/6-statistiques-prepa.ipynb

147 lines
2.7 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import random"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Préparation des données stats"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['grise',\n",
" 'noire',\n",
" 'grise',\n",
" 'rouge',\n",
" 'blanche',\n",
" 'blanche',\n",
" 'rouge',\n",
" 'bleu',\n",
" 'bleu',\n",
" 'grise',\n",
" 'noire',\n",
" 'verte',\n",
" 'noire',\n",
" 'rouge',\n",
" 'grise',\n",
" 'verte',\n",
" 'grise',\n",
" 'grise',\n",
" 'verte',\n",
" 'grise']"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"couleurs = [\"rouge\", \"noire\", \"blanche\", \"grise\", \"verte\", \"bleu\"]\n",
"rand_color = [random.choice(couleurs) for _ in range(20)]\n",
"rand_color"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[68806,\n",
" 136429,\n",
" 67417,\n",
" 44743,\n",
" 166108,\n",
" 63686,\n",
" 133615,\n",
" 97402,\n",
" 131932,\n",
" 60947,\n",
" 166706,\n",
" 194451,\n",
" 103493,\n",
" 71308,\n",
" 69805]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kms = [int(random.gauss(100000, 50000)) for _ in range(15)]\n",
"kms"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 2, 1, 2, 4, 5, 5]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nbr_passagers = list(range(6))\n",
"passagers = [random.choice(nbr_passagers) for _ in range(7)]\n",
"passagers"
]
},
{
"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.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}