AIM-PIbd-32-Katysheva-N-E/lab_1/lab1.ipynb

175 lines
58 KiB
Plaintext
Raw Normal View History

2024-09-13 21:24:33 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Начало лабораборной\n",
"\n",
"Выгрузка данных из csv файла в датафрейм"
]
},
{
"cell_type": "code",
2024-09-14 12:05:45 +04:00
"execution_count": 2,
2024-09-13 21:24:33 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Index(['gender', 'race/ethnicity', 'parental level of education', 'lunch',\n",
" 'test preparation course', 'math score', 'reading score',\n",
" 'writing score'],\n",
" dtype='object')\n"
]
}
],
"source": [
"import pandas as pd\n",
2024-09-13 23:22:35 +04:00
"import numpy as np\n",
2024-09-13 21:24:33 +04:00
"\n",
2024-09-13 21:27:08 +04:00
"df = pd.read_csv(\"..//..//static//csv//StudentsPerformance.csv\")\n",
2024-09-13 21:24:33 +04:00
"print (df.columns)"
]
2024-09-13 23:36:58 +04:00
},
2024-09-14 12:05:45 +04:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная гистограмма в диапазоне с 10 по 51 строки отображает:\n",
"На оси X значения оценок по математике, разбитые на 100 интервалов.\n",
"На оси Y будет указано количество записей (частота) в каждом из этих интервалов. \n",
"Анализируя гистограмму \"math score\", можно сделать выводы о том, как распределяются оценки.\n",
"Например, оценку 70 имеет 4 человека, а оценку 18 всего 1 человек из этого диапазона."
]
},
2024-09-13 23:36:58 +04:00
{
"cell_type": "code",
2024-09-14 12:05:45 +04:00
"execution_count": 10,
2024-09-13 23:36:58 +04:00
"metadata": {},
"outputs": [
{
2024-09-13 23:24:00 +04:00
"data": {
"text/plain": [
"<Axes: ylabel='Frequency'>"
]
},
2024-09-14 12:05:45 +04:00
"execution_count": 10,
2024-09-13 23:24:00 +04:00
"metadata": {},
"output_type": "execute_result"
},
2024-09-13 23:36:58 +04:00
{
2024-09-13 23:24:00 +04:00
"data": {
2024-09-14 12:05:45 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uKJJxQTE6NWrVopMTHRMbm7Ju3atdP27dv11FNP6Z577lFlZaU6deqk4cOHe/TltRbDMAyPnd0DysrKFBwcrNLSUiY/A/Aq1T3a3tgCw/nz53X06FFFRUXV6ZPAaJiudv3d+fe7QX/sBQAA4G6EHwAAYCqEHwAAYCqEHwAAYCqEHwBAg2OyZ3Hw/9XXdSf8AAAajEvfWHzpxZ8wl0vfbF3dWx7cqUF9zw8AwNx8fHzUokULx/upmjVr5vQ+KXgvu92u06dPq1mzZnX+bdCEHwBAg3LpZdU1vaAT3qtJkybq2LFjnQdewg8AoEGxWCwKDw9XSEiIy69yQOPk7+9fL9/8TPgBADRIPj4+dT73A+bEhGcAAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqhB8AAGAqHg0/ixYtUu/evRUUFKSgoCDZbDZt3Lixxv7p6emyWCxOS9OmTeuxYgAA0Nj5evLkHTp00Ny5cxUdHS3DMPTGG29o9OjRysvL080331ztPkFBQTpw4IBj3WKx1Fe5AADAC3g0/IwaNcpp/YUXXtCiRYv02Wef1Rh+LBaLwsLC6qM8AADghRrMnJ+qqiplZGSooqJCNputxn7
2024-09-13 23:24:00 +04:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2024-09-13 23:36:58 +04:00
}
],
"source": [
2024-09-13 23:22:35 +04:00
"\n",
2024-09-14 12:05:45 +04:00
"df.iloc[10:51].plot.hist(column=[\"math score\"], bins=100)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная гистограмма отображает прцоентное соотношение мужчин и женщин.\n",
"Что позволяет сделать вывод о том, что женщин среди студентов больше, чем мужчин. "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAGFCAYAAAASI+9IAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAv6ElEQVR4nO3dd3hUZcL+8e/MpBcICYRQQjOELkUFCygIduzK2kCXxVUXfXXVdVd3ddVX1rI/677q7soCuqigK0VFXSsgFhQQKaFJCwmppJdJJjPz+2N0JIKUtGfOmftzXbniTGYm9yR47pzznPM8Dr/f70dERARwmg4gIiKhQ6UgIiJBKgUREQlSKYiISJBKQUREglQKIiISpFIQEZEglYKIiASpFEREJEilICIiQSoFEREJUimIiEiQSkFERIJUCiIiEqRSEBGRIJWCiIgEqRRERCRIpSAiIkEqBRERCVIpiIhIkEpBRESCVAoiIhKkUhARkSCVgoiIBKkUREQkSKUgIiJBKgUL27p1K507d+amm25qdP/SpUtxOByUlZUF73O73YwbN47hw4c3ul9EZH8RpgNI02VmZvLee+8xbtw4kpKSePjhhw/6uIaGBi6//HL27t3Lp59+SlJSUtsGFRHL0J6CxQ0fPpwlS5bwzDPP8Nhjjx3wdZ/Px7XXXsu3337LBx98QGpqKgB1dXXceeeddOvWjfj4eEaNGsXSpUuDz5szZ84B5bFr1y4cDgdr164FDr5HMmzYMO6///6ffZ2DPWfy5Mk4HA4WLVp00O/zg169evHUU08Fb+//nJ/6aQ4ROTLaU7CBU045hQULFnDBBRfQvn17+vXrF/za9OnT+eCDD1ixYgU9evQI3n/zzTeTlZXFvHnz6Nq1KwsXLuTss89m/fr19O3bt82yr169mjfffLPNvp+IHJr2FGyiffv2+Hw+brnlFubNmwfA3XffzcyZM/F6vY3+Ws/Ozmb27Nm8/vrrjBkzhmOOOYY777yT0aNHM3v27DbNffvtt/O73/2uTb+niPw8lYIN1NfXM23aNG688Uaee+45/vGPfwDw4osv8tFHHzFo0CBuvvnm4O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CzWTtreAPC9axLqfcdBSxuQing1+N7s1tEzKJjdLaDnahUrAJt8fLkx9u5V+f7qRBh4qkDXVLiuXBCwcxfkBn01GkBagUbGDFtmLuWbie7JIa01EkjJ01qDMPXTSETola8MfKVAoWVun28MBbWfxndY7pKCIAJMdH8ZeLh3D24DTTUaSJVAoWtWpXCbfNX0tOqeYpktBz6Yju3H/BQBK1CpzlqBQspsHr4+mPtvHc0u06zVRCWrekWP7f5UM56ZgU01HkKKgULGRXcTW3zl/Lt3vKTEcROSIOB/zqlN7cdXZ/oiK0NKgVqBQs4rWv93D/WxupqfeajiJy1IamJ/Hc1SPolhRrOoochkohxLk9Xu5dtIHXNZgsFpcUF8mTvxjGuH6ppqPIIagUQlhOaQ03zV3D+lxdiCb24HDAzeMy+O2ETK0VHaJUCiFqxbZibnl1DaU1HtNRRFrc6IyOPH3FMFISdE1DqFEphKDnln7H4+9v1dlFYmtd2sfwwpTjGdytvekosh+VQghxe7zc/tpa3lmfbzqKSJuIi3Lx9BXDOWOgpsgIFSqFELGvqo5pL63im+wy01FE2pTTAfecO4BpY/qYjiKoFELCzuJqrpv9Fbv3ae4iCV9Xj+rBAxcMIsKl6xlMUikYtnp3CdNeXKUBZRHg1MxOPHvVcE2PYZBKwaB31ufx2/lrqWvwmY4iEjL6pyXy0tSRpLbTmtAmqBQMefHzXdz/1kb00xc5UI/kOOb+ahQ9UuJMRwk7KgUD/rFsOw+/u9l0DJGQlpoYzb9/NUpLfrYxlUIbe/rDbTz54VbTMUQ
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt \n",
"\n",
"labels = 'Женщины', 'Мужчины'\n",
"sizes = [len(df[df['gender']== 'female']),\n",
" len(df[df['gender']== 'male'])]\n",
"\n",
"plt.pie(sizes, labels=labels, autopct='%1.1f%%')\n",
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная диаграмма отображает соотношение студентов, которые прошли курс подготовки к тестированию по группам.\n",
"Что позволяет сделать вывод о том, что, например, больше всего неподготовленных студентов в группе С."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x2d8c973ba70>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAigAAAHaCAYAAAAqv7IKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA6TElEQVR4nO3de3RNd/7/8ddJIpGQSxOXJNMgdY26hZamWgQl0aoOo6V03KrqTrS1MtO6tKPRFr0aZloS+qW0U7ea74+6lboTE4ZRJUMpEVSTNPEVkezfH13OzGlChZxzPpLnY629Vvb+fM7e75PPxsu+2izLsgQAAGAQD3cXAAAA8EsEFAAAYBwCCgAAMA4BBQAAGIeAAgAAjENAAQAAxiGgAAAA43i5u4BbUVRUpDNnzsjf3182m83d5QAAgJtgWZZ++uknhYeHy8PjxsdI7siAcubMGUVERLi7DAAAcAtOnTqlu++++4Z97siA4u/vL+nnLxgQEODmagAAwM3IyclRRESE/d/xG7kjA8q10zoBAQEEFAAA7jA3c3kGF8kCAADjEFAAAIBxCCgAAMA4d+Q1KAAAsxUWFqqgoMDdZcDFKlWqJE9PzzJZFwEFAFBmLMvS2bNnlZWV5e5S4CZBQUEKDQ297eeUEVAAAGXmWjipUaOG/Pz8eJhmBWJZli5duqRz585JksLCwm5rfQQUAECZKCwstIeTkJAQd5cDN/D19ZUknTt3TjVq1Lit0z1cJAsAKBPXrjnx8/NzcyVwp2vjf7vXIBFQAABlitM6FVtZjT8BBQAAGIeAAgDAHaBq1apavXq1Fi1a9Ksv2isPuEgWAOB8m/e6blvt7yv1RwYOHKgFCxZct/3HH39UUFDQbR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BAZWVlubuMCqNUR1Bu5rxZ5cqVNXv2bM2ePfu6fWrXrq3//d//Lc2mAQBABcK7eAAAgHEIKAAAwDgEFAAAYBwCCgAAMA4BBQAAGIeAAgBABVe1alWtXr1aixYtcnhCvDvd8rt4AAC4WbapNpdty5pc+kfJX3vGyYoVKxyWf/XVV4qNjdWPP/5Y7EW45UlaWprCwsJUVFSkBx980N3lSCKgAABQ4dWrV8/+s7+/vxsr+Q9O8QAAUApbt27Vww8/LF9fX0VERGjMmDHKy8u7bv8pU6bIZrOVOF17Mm1KSoqCgoK0YsUK1a9fX5UrV1bXrl116tQph3XNmTNHdevWlbe3txo2bKiPP/7Yod1mszkcBRo3bpzDm5RPnDghm82mtLQ0+7KDBw8qPj5eVatWVc2aNfXMM8/owoULDutNSUkpVnuLFi1K9XsrLQIKAAA3KT09XXFxcerVq5cOHDigpUuXauvWrRo1atQNP3fvvfcqIyPDPn3++efF+ly6dEnTpk3TwoULtW3bNmVlZalPnz729uXLl2vs2LGaMGGCDh48qGHDhmnQoEHatGnTLX+frKwsdezYUdHR0dq7d6/WrFmjzMxMPfnkkw79LMtSQECAvf4JEybc8jZvFqd4AACQtHr1alWtWtVhWWFhocN8UlKS+vXrp3HjxkmS6tevr/fee0/t27fXnDlzVLly5RLX7eXlpdDQUPt8cHBwsT4FBQX64IMP1KZNG0nSggULFBUVpd27d6t169aaMWOGBg4cqBEjRkiSEhIStHPnTs2YMUOxsbG39J0/+OADRUdH6/XXX7cvmz9/viIiIvTtt9+qQYMG9tq8vb3t3+GXvydn4AgKAACSYmNjlZaW5jB99NFHDn3279+vlJQUVa1a1T517dpVRUVFOn78+G1t38vLS/fff799vlGjRgoKCtLhw4clSYcPH1bbtm0dPtO2bVt7+63Yv3+/Nm3a5PB9GjVqJOnno0XX5OTkqEqVKre8nVvBERQAACRVqVLF4WJRSfr
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plot = df.groupby([\"race/ethnicity\", \"test preparation course\"]).size().unstack().plot.bar(color=[\"pink\", \"green\"])\n",
"plot.legend([\"Прошёл\", \"Не прошёл\"])"
2024-09-13 23:36:58 +04:00
]
2024-09-13 21:24:33 +04:00
}
],
"metadata": {
"kernelspec": {
"display_name": "aimenv",
"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.12.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}