AIM-PIbd-31-Makarov-DV/lab_1/lab1.ipynb

328 lines
143 KiB
Plaintext
Raw Normal View History

2024-11-08 16:18:39 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Начало ЛР\n",
"\n",
"Выгрузка данных из CSV в датафрейм"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Education Level</th>\n",
" <th>Institution Type</th>\n",
" <th>Gender</th>\n",
" <th>Age</th>\n",
" <th>Device</th>\n",
" <th>IT Student</th>\n",
" <th>Location</th>\n",
" <th>Financial Condition</th>\n",
" <th>Internet Type</th>\n",
" <th>Network Type</th>\n",
" <th>Flexibility Level</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>University</td>\n",
" <td>Private</td>\n",
" <td>Male</td>\n",
" <td>23</td>\n",
" <td>Tab</td>\n",
" <td>No</td>\n",
" <td>Town</td>\n",
" <td>Mid</td>\n",
" <td>Wifi</td>\n",
" <td>4G</td>\n",
" <td>Moderate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>University</td>\n",
" <td>Private</td>\n",
" <td>Female</td>\n",
" <td>23</td>\n",
" <td>Mobile</td>\n",
" <td>No</td>\n",
" <td>Town</td>\n",
" <td>Mid</td>\n",
" <td>Mobile Data</td>\n",
" <td>4G</td>\n",
" <td>Moderate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>College</td>\n",
" <td>Public</td>\n",
" <td>Female</td>\n",
" <td>18</td>\n",
" <td>Mobile</td>\n",
" <td>No</td>\n",
" <td>Town</td>\n",
" <td>Mid</td>\n",
" <td>Wifi</td>\n",
" <td>4G</td>\n",
" <td>Moderate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>School</td>\n",
" <td>Private</td>\n",
" <td>Female</td>\n",
" <td>11</td>\n",
" <td>Mobile</td>\n",
" <td>No</td>\n",
" <td>Town</td>\n",
" <td>Mid</td>\n",
" <td>Mobile Data</td>\n",
" <td>4G</td>\n",
" <td>Moderate</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>School</td>\n",
" <td>Private</td>\n",
" <td>Female</td>\n",
" <td>18</td>\n",
" <td>Mobile</td>\n",
" <td>No</td>\n",
" <td>Town</td>\n",
" <td>Poor</td>\n",
" <td>Mobile Data</td>\n",
" <td>3G</td>\n",
" <td>Low</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Education Level Institution Type Gender Age Device IT Student Location \\\n",
"0 University Private Male 23 Tab No Town \n",
"1 University Private Female 23 Mobile No Town \n",
"2 College Public Female 18 Mobile No Town \n",
"3 School Private Female 11 Mobile No Town \n",
"4 School Private Female 18 Mobile No Town \n",
"\n",
" Financial Condition Internet Type Network Type Flexibility Level \n",
"0 Mid Wifi 4G Moderate \n",
"1 Mid Mobile Data 4G Moderate \n",
"2 Mid Wifi 4G Moderate \n",
"3 Mid Mobile Data 4G Moderate \n",
"4 Poor Mobile Data 3G Low "
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"dataframe = pd.read_csv(\".//static//csv//students_adaptability_level_online_education.csv\")\n",
"dataframe.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Диаграмма 1 (Круговая)\n",
"\n",
"Данная диаграмма (круговая) отображает распределение людей по типу соединения к интернету (4G, 3G, 2G). Это позволяет сделать вывод о том, что люди с низким уровнем заработка имеют чаще всего 3G и 4G (одинаково), чем 2G."
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0.5, 1.0, 'Распределение людей низкого уровня заработка по типу соединения')"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnwAAAH4CAYAAADQJDAFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABmvUlEQVR4nO3dd3xT5eIG8CejTdqmg25mW2gpGwRlLwEFBBFUhl4F8aeg4rpuHBfBgVzHBVERxIGCspGhIqCIoCgbWkZZLdBB90ybpEnO74/S2DRpm5a2b5I+34/9YE9PkidpevLknPc9kUmSJIGIiIiI3JZcdAAiIiIialgsfERERERujoWPiIiIyM2x8BERERG5ORY+IiIiIjfHwkdERETk5lj4iIiIiNwcCx8RERGRm2PhIyKiOiksLERSUhK0Wq3oKERUAxY+omq8/fbbMJvNAACz2Yz58+cLTkQkjiRJWLZsGfr27Qtvb2/4+fkhKioKK1euFB2NiGpQq8L31VdfQSaTWb7UajXat2+Pxx9/HOnp6Q2VkUiYFStW4L333kNycjLef/99rFixQnQkImHuvfdePPLII+jYsSO++eYb7Ny5E7t27cKdd94pOhoR1UBZlwvNmzcPUVFR0Ol02LdvH5YsWYIff/wR8fHx8Pb2ru+MRMLMmzcPU6dOxYsvvgiVSsU9GdRkff3111izZg1WrlyJe++9V3QcIqolmSRJkqMrf/XVV5g+fToOHjyIG2+80bL82WefxQcffIBvv/0W99xzT4MEJRIlIyMD58+fR0xMDEJCQkTHIRKia9eu6NatG1atWiU6ChHVQb2M4Rs2bBgAIDExEQCQk5OD5557Dl27doVGo4Gfnx9Gjx6N48eP21xWp9Ph9ddfR/v27aFWq9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cbmttavX2+z3QUc6wvlz9WKjwcAHDp0yO7tV359unLlCry8vGzug9FoxJtvvon27dtDpVJZ3f/K26Xq1OmQbmXl5SwoKAhA2R/7999/j4kTJyIqKgrp6elYunQphgwZglOnTqFFixYAAJPJhLFjx+KXX37BlClT8NRTT6GwsBA7d+5EfHw82rVrZ7mNe+65B7fddpvV7c6ePdtunrfeegsymQwvvvgiMjIysHDhQowYMQLHjh2Dl5cXAODXX3/F6NGj0atXL8yZMwdyuRxffvml5QW0d+/eNtfbqlUry6D9oqIiPProo3Zv+7XXXsOkSZPw0EMPITMzE4sXL8bgwYNx9OhRBAQE2FxmxowZGDRoEABg48aNNn+QM2fOtOxdffLJJ5GYmIiPPvoIR48exR9//AEPDw+7j0Nt5OXl2Z2QYDabMW7cOOzbtw8zZsxAx44dERcXh//97384e/Ysvv/+e4dvo6b7WZHBYMCIESNw5swZPProo4iNjcX333+PGTNmIDs7Gy+99JLdy5UPNwCA999/32bjcfLkSQwYMAAtW7bESy+9BB8fH6xduxbjx4/Hhg0bMGHChCozffPNN4iLi3P4/l6P999/3+64WIPBgPvuuw+tWrVCTk4Oli5dilGjRuH06dNo06aN3euaM2cOPv/8c6xZs8bqhev111/H3LlzMWLECDz66KNISEjAkiVLcPDgQZvnVcXnfrnmzZtb/v+hhx7CihUrcPfdd+PZZ5/F33//jfnz5+P06dPV/p7vvvtuzJo1C6tWrcINN9xg9bNVq1Zh6NChaNmypWVZbm4ubrvtNkyaNAn33HMP1q5di0cffRSenp548MEHAQAlJSUYOnQozp8/j8cffxxRUVFYt24dHnjgAeTl5eGpp56yup3y56Ver8fPP/+M9957D2q1Gm+88UaVuauSmJiIMWPGoHnz5vjPf/5j2SN8//3313jZwsJCdOzYEZMmTYK3tzf279+P//73vyguLsbixYsBOL5tLefItnDdunUoLi7Go48+iqCgIBw4cACLFy9GcnIy1q1bBwDIzs4GACxYsADh4eF4/vnnoVar8dlnn2HEiBHYuXMnBg8eDABIT09H//79UVxcjCeffBJBQUFYsWIFxo0bh/Xr12PChAmWMYDlli1bhtOnT+N///ufZVm3bt3sPk7Hjx/H+PHjcdttt+Hjjz+2LD948CD+/PNPTJkyBa1atUJSUhKWLFmCoUOH4tSpUw4NN3Lkdaa2z6+KFi5ciKKiIgDA6dOn8fbbb+Pll19Gx44dAcBuASl3/vz5Kt/wAtbbPsD2NWro0KFo3bo1Vq1aZbOdW7VqFdq1a4d+/fpVef1FRUUYNGgQTp8+jQcffBA9e/ZEVlYWtmzZguTkZAQHB9fqsanL61rF38+PP/6I7777rsq85epju12XvlAX//nPf6ze4JV7//338dprr2HChAmW4UV79+7FsmXLancDUi18+eWXEgBp165dUmZmpnTlyhVp9erVUlBQkOTl5SUlJydLkiRJOp1OMplMVpdNTEyUVCqVNG/ePMuyL774QgIgffDBBza3ZTabLZcDIL377rs263Tu3FkaMmSI5fvdu3dLAKSWLVtKBQUFluVr166VAEiLFi2yXHdMTIw0cuRIy+1IkiQVFxdLUVFR0i233GJzW/3795e6dOli+T4zM1MCIM2ZM8eyLCkpSVIoFNJbb71lddm4uDhJqVTaLD937pwEQFqxYoVl2Zw5c6SKv5a9e/dKAKRVq1ZZXXb79u02yyMiIqQxY8bYZJ81a5ZU+VddOfsLL7wghYaGSr169bJ6TL/55htJLpdLe/futbr8p59+KgGQ/vjjD5vbq8yR+1k50+LFiyUA0qeffmr5udFolIYPHy6pVCopKyvL6rLLli2TAEiHDh2yLBszZowUERFhtd7w4cOlrl27SjqdzrLMbDZL/fv3l2JiYizLyp/riYmJkiSVPafbtGkjjR49WgIgffnll9Xe5/LLHzx40Gq5vedN5cciIyND8vX1tdzW7t27q7ydAwcOSACk9evXW5ZFRERI06ZNkyRJkpYuXSoBkBYvXmx1uYyMDMn
"text/plain": [
"<Figure size 600x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"rural_df = dataframe[dataframe['Financial Condition'] == \"Poor\"]\n",
"\n",
"network_type_rural_count = rural_df['Network Type'].value_counts()\n",
"\n",
"plt.figure(figsize=(6,6))\n",
"plt.pie(network_type_rural_count, labels=network_type_rural_count.index, autopct='%1.2f%%')\n",
"plt.title(\"Распределение людей низкого уровня заработка по типу соединения\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Диаграмма 2 (Линейная)\n",
"\n",
"Данная диаграмма выполнена на срезе данных и отображает количество студентов в разных возрастных группах. Из нее можно сделать вывод, что в подростковом возрасте (10-15) люди менее интересуются IT направлением, но в возрасте 20-25 лет количество учеников IT направлений начинает преобладать над не IT сферой (и в это же время количество не IT студентов начинает убывать)."
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x71e288175ac0>"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1IAAAJGCAYAAABRFrQ+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAADHjklEQVR4nOzdd3hT5f/G8Xe6d8sqLXsKlL1kDwHZMgRENiiCSEVFEXGAKMpwIVNxsBGUPQRE9t5lg4yyKS1gW0rpTH5/5Ee/lhZoS9N03K/rygU5OTnnTptCP3me83kMJpPJhIiIiIiIiKSYjbUDiIiIiIiIZDUqpERERERERFJJhZSIiIiIiEgqqZASERERERFJJRVSIiIiIiIiqaRCSkREREREJJVUSImIiIiIiKSSCikREREREZFUUiElIiIiIiKSSiqkREREREREUkmFlEgWNmvWLAwGAwcOHEjy2E8//YTBYKBDhw7Ex8dbIZ1IzvTpp59iMBi4desWW7ZswWAwpOiWHTRu3JgKFSoA//s6POnWuHFj64YWEUkjO2sHEJH0t2zZMgYNGkSDBg1YuHAhtra21o4kkiOVK1eOuXPnJto2YsQI3Nzc+Oijj6yUKmO8+OKLlCpVKuF+REQE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0aBEffvgh3t7evPrqqwCcOHGCBg0a4OHhwfvvv4+9vT0//vgjjRs3ZuvWrdSqVeuxry098rq5udGxY0cWLVrEt99+m2ja5m+//YbJZKJHjx5Jzu3o6MjPP/+ccL9///5J9pk7dy59+vShRYsWjB8/nsjISKZPn079+vU5fPgwxYoVe+zre9hHH32UcJ5bt27xzjvvMGDAABo0aJBk3/79+zN79mw6d+7Mu+++y969exk7diynTp1i2bJlifZt0KABAwYMwGg0cvz4cSZOnMj169fZvn17qvI9zvTp0ylfvjzt2rXDzs6OVatW8cYbb2A0Ghk8eHC6nSettm3bxp9//pnux03Nz19ms2HDBi5cuEC/fv3w8fHhxIkTzJgxgxMnTrBnz54kv9RPnz490QcCgYGBjBw5Mslx4+PjadmyJbVr12bChAmsW7eOUaNGERcXx2effZaw3/fff0+7du3o0aMHMTExLFy4kC5durB69WratGmT6JgP/l2Ni4tj9+7dzJgxg/v37yeZBgqQN29evvvuu4T7vXr1SvT4iRMnqFevHgULFuSDDz7A1dWV33//nQ4dOrBkyRI6duyYui/kI3zzzTfcvHkzRfsOHz48Xc4pkumZRCTLmjlzpgkwrV692lSyZEkTYGrevHmy+8bExJi8vb1NFSpUMN2/fz9h++rVq02AaeTIkYn2j42NNQGm0aNHJzlfYGBgwjbANGrUqIT777//vsnb29tUvXp1U6NGjRK2jx492gSYjEZjovMULVrU1KdPn4T7n3/+ucnV1dX0zz//JNrvgw8+MNna2pouX75sMplMpk2bNpkA05AhQ5K81ofP8ajsD2zevNkEmDZv3pywLSoqymRjY2N64403ErZ16NDB5ODgYDp//nzCtuvXr5vc3d1NDRs2THLc/0rPvOvXrzcBprVr1ybaXqlSpURf8we6d+9ucnNzS7TN1dU10df97t27Ji8vL9Nrr72WaL+goCCTp6dnou19+vQxubq6JjnPH3/8keTr+EBgYKAJMM2cOTPJYwEBASbA1L9//0Tb33vvPRNg2rRpU8K2h98vD16fi4tLkuM+rGjRoqY2bdok2T548GDTw/8dRkZGJtmvRYsWphIlSjzxPKN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04dDAYDI0aMYMyYMQnHffi6i7Nnz3L06FHy5cuX7DmCg4MB81TGAgUKkDt37hTne5IOHTok/N3GxoaPP/6YTp06ARASEkJkZGSyX79y5cp
"text/plain": [
"<Figure size 1000x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df_cut = dataframe.iloc[0:1500]\n",
"\n",
"it_student_df = df_cut[df_cut['IT Student'] == \"Yes\"].copy()\n",
"nonit_student_df = df_cut[df_cut['IT Student'] == \"No\"].copy()\n",
"\n",
"age_bins = range(10, 36, 5)\n",
"\n",
"\n",
"it_student_df['age_group'] = pd.cut(it_student_df['Age'], bins=age_bins)\n",
"it_student_count = it_student_df.groupby('age_group', observed=False)['IT Student'].value_counts().reset_index()\n",
"mean_count_it = it_student_count.groupby('age_group', observed=False)['count'].mean()\n",
"\n",
"nonit_student_df['age_group'] = pd.cut(nonit_student_df['Age'], bins=age_bins)\n",
"nonit_student_count = nonit_student_df.groupby('age_group', observed=False)['IT Student'].value_counts().reset_index()\n",
"mean_count_nonit = nonit_student_count.groupby('age_group', observed=False)['count'].mean()\n",
"\n",
"plt.figure(figsize=(10,6))\n",
"plt.plot(mean_count_it.index.astype(str), mean_count_it , marker='o', label='IT студент')\n",
"plt.plot(mean_count_nonit.index.astype(str), mean_count_nonit , marker='o', label='Не IT студент')\n",
"plt.xlabel(\"Возрастная группа\")\n",
"plt.ylabel(\"Количество студентов\")\n",
"plt.title('Количество студентов на IT и не IT направлении')\n",
"plt.xticks(rotation=45)\n",
"plt.legend()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Диаграмма 3 (Гистограмма)\n",
"\n",
"Данная диаграмма отображает количество людей по типу соединения к сети Интернет. На основе этой диаграммы можно сделать вывод, что чаще всего используют мобильный интернет, чем Wi-Fi"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'Количество')"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1kAAAIjCAYAAADxz9EgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABcDUlEQVR4nO3deZyN9f//8ecxZjObhlnIYOxGyvaJQdmGsVU+lJTsRRplKcmnbCNNRNYJbSikyF72UGnskT2KRjEztpkxNAtz/f7wm/N1zGLmuBjD4367nRvnut7Xdb3e51xzznme67rex2IYhiEAAAAAgCkK5XcBAAAAAHAvIWQBAAAAgIkIWQAAAABgIkIWAAAAAJiIkAUAAAAAJiJkAQAAAICJCFkAAAAAYCJCFgAAAACYiJAFAAAAACYiZAHAPeC9995Tenq6JCk9PV0RERH5XBEAAPcvQhbuSbNnz5bFYrHeXFxcVKlSJfXr10+xsbH5XR5gujlz5mj8+PH6+++/NWHCBM2ZMye/SwJQQFgsFvXr1y/T9E2bNlnfR3fu3JkPlQEFV+H8LgC4ncLDwxUYGKjk5GT9/PPPmj59ur7//nvt379fRYoUye/yANOEh4era9euGjJkiJydnTV37tz8LglAATdy5Mj8LgEosAhZuKe1atVKderUkSS9+OKLKlasmD788EMtW7ZMzz33XD5XB5jn2WefVZMmTXTs2DFVrFhRPj4++V0SgAJs8+bN2rx5s2rUqKE9e/bkdzlAgcPpgrivNG3aVJJ0/PhxSdL58+f1xhtvqHr16nJ3d5enp6datWqlvXv3Zlo2OTlZI0eOVKVKleTi4qISJUqoffv2+uOPPyRJJ06csDlF8cZb48aNrevKOAXj66+/1v/+9z/5+/vLzc1NTz75pE6ePJlp29u2bVPLli3l5eWlIkWKqFGjRtqyZUuWfWzcuHGW28/qG8m5c+eqdu3acnV1lbe3tzp16pTl9nPq2/XS09M1adIkVatWTS4uLvLz81OfPn104cIFm3Zly5ZV27ZtM22nX79+mdaZVe0ffPBBpsdUklJSUjRixAhVqFBBzs7OCggI0JtvvqmUlJQsHyt7+3ljTTExMeratat8fHzk7Oyshx56SJ988kmW27jxVNaMW9myZTO1PXz4sJ5++ml5e3vLxcVFderU0fLly7Nc34kTJ+Tr66v69eurWLFievjhh2WxWDR79uwc+5xdPdntN7/++qtatWolT09Pubu7q1mzZtq6dWuO27jZ34bFYlH37t0z9SdDenp6lv3p3r17juvctGmTJGnEiBFydHTUmTNnMtXWu3dvFS1aVMnJydnWn9vtZFi4cKH176p48eJ64YUX9M8//2S57rJly2a5zuv7mfH4XT/t4sWLql27tgIDA3X69GmbdY4cOTLHxzi7x3nNmjWqX7++ihQpIi8vL7Vt21b79++3WXfjxo0z/d1lVZ+Ut/33xlPRzp49m2n/y+jX9ZKSkuTv75/l8zB9+nQ99NBDKlKkiM3jsGjRIuUkq+1s3LhRzs7Oevnll3NcVrr5e4WUu9fK7PaNG18zsnv8w8LCMj3veTFy5Ej5+/urd+/emeZ1795d7u7umaYvWrTI5rnI7v0ou9fW3LwnNW7cWA899JB27dql+vXry9XVVYGBgZoxY4ZNu4z32ayeb3d390yPS3x8vAYMGKCAgAA5OzurQoUKGjt2rPVa17y8jgESR7Jwn8l4kytWrJgk6c8//9TSpUv1zDPPKDAwULGxsZo5c6YaNWqkgwcPqmTJkpKkq1evqm3bttqwYYM6deqk/v376+LFi1q3bp3279+v8uXLW7fx3HPPqXXr1jbbHTp0aJb1jBkzRhaLRUOGDFFcXJwmTZqkkJAQ7dmzR66urpKkH374Qa1atVLt2rU1YsQIFSpUSLNmzVLTpk31008/6dFHH8203lKlSlkHPkhKSlLfvn2z3PawYcPUsWNHvfjiizpz5oymTp2qxx9/XL/++quKFi2aaZnevXvrsccekyQtXrxYS5YssZnfp08fzZ49Wz169NBrr72m48ePa9q0afr111+1ZcsWOTo6Zvk45EV8fHyWgzqkp6frySef1M8//6zevXuratWq2rdvnyZOnKjff/9dS5cuzfU2btbP66WmpiokJESHDx9W3759VblyZS1dulS9e/fWuXPn9NZbb2W5XMaprJI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lypSxadesWTOjevXqRnJysnVaenq6Ub9+faNixYrWaRn7+vHjxw3DuLZPly5d2mjVqpUhyZg1a1aOfc5YfseOHTbTs9pv2rVrZzg5ORl//PGHddqpU6cMDw8P4/HHH89xO9fL6jG1pz/dunUz3NzcMq1j4cKFhiRj48aN1mnBwcFG3bp1bdotXrw4U7us5HY7qamphq+vr/HQQw8Z//77r7XdypUrDUnG8OHDM62jZMmSRtu2ba33d+zYkamfGa8ts2bNMtLT043OnTsbRYoUMbZt25ZlvW+//bZhsVhsppUpU8bo1q2b9f6Nj3Pt2rUNLy8vIyYmxtrm999/NxwdHY0OHTpYpzVp0iTTc319fRnyuv/mZv+7cb+Ji4szPDw8rPvG9c/jc889ZxQtWtTmech43V24cGEWj9r/uX47J06cMEqUKGE0bNjQZl3Zyc17RV5eK2+sPat9NavHv2PHjsZDDz1kBAQE2Dzv2ZFkhIWFWe83adLE8Pf3Ny5fvpzlc5SXv72c6syQl/ekRo0aGZKMCRMmWKelpKQYNWrUMHx9fY3U1FTDMHJ+vt3c3Gwel9GjRxtubm7G77//btPurbfeMhwcHIzo6OhM68jpdQwwDMPgdEHc00JCQuTj46OAgAB16tRJ7u7uWrJkiR588EFJ176dLlTo2p/B1atXde7cObm7u6ty5cravXu3dT3ffvutihcvrldffTXTNm483SEvunbtKg8PD+v9p59+WiVKlND3338vSdq
"text/plain": [
"<Figure size 1000x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(10,6))\n",
"plt.hist(dataframe.head(20000)['Internet Type'], bins=4, edgecolor='black')\n",
"plt.title(\"Распределение людей по типу подключения к сети Интернет\")\n",
"plt.xlabel(\"Тип подключения к сети Интернет\")\n",
"plt.ylabel(\"Количество\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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
}