pred_analytics/lab1.ipynb

359 lines
293 KiB
Plaintext
Raw Permalink Normal View History

2025-01-13 14:42:39 +04:00
{
"cells": [
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA98AAABTCAYAAACGabSOAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACk0SURBVHhe7d0LbFz1nS/w30CjBilJSYooThqWhBnD9XrVmzSAmLn3NqJt0NhFMtpikHpXZllphvtoPWoB7XaN1If7UNNSDyutmFk1YN2LBKFLfW+IR4THpr3yUApNlouxWM+UsNDYAaGYklw1bRb5/n//8z9nzvsxD2ce34/kxOd9zv/8z/j/m//jxJaWllbJx6FDhyiTyaipLlHKUmyoSJSZpdVCWs10IdZLifXKyQzNThcoHVfzATpANZ+i/f1zZM7iPC+RK4usv+qYb19XU6V8KkELE9b1daVsjPhRSk5VaG7c/QHhdSYHnMv1be3nAp3n7fcr6jfN0UeX6S7aTG98ab2a0/7efO49uql0MR344Wbaq+bp/JZ1Ank/3tlIz391A12l5q21djiHZguTL7rxuv1Y0+Q8HXjgPZqk7r3+Tvhs6LU8CHChbL80oX7zd5H6H+yqeS3wJhF4z/VW4B2LxdRv0Mniw6M0P1NSU36qdPjgII14BcCDU3RvQHBcXrAGX9A76v68mF+hnfe8RwfeVdM6r/ktdZ6ef+U80a5LXArQfsugd7UwX1yQZ0Bp6Nj2NFlHd321j97o2qCviz8bOjYPAlw4YctDCL5dVSk/lhOBN9fKicBbmwnQWeLDNDo/Q4Hhd/UwHRwc8cjncRovjIt/3ZRopqj9lvGM3AE6wLt/oMNLRHd8yqWm3m8Z9C7kC6deSxPkAQCoA5qdu7el1ZYnp6gy5xV4dC/+5mZ11TdbQIfg5uRjNG00+XZrds7Nv2dGojT9rlK1dJj2T+aoWPZvcs7Q7Ly78efFWyuLakqjNzt//oqz9NnSeTlvdWut2SMv/6vjcrbh36cvoy+fes91/j9+dp3c5u+uuIx+RL+r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u4eDQM1+EuaYwae0l4raOZ6DeNLdxe7Z8n5VmCHtfG73/IdPI83qb8Sw1cp/CbNsFeRCgXaHPd93SNMKVgeWDdNgrGHGpFe8m6PPdBap5GpP9uzM06zuUeJzGp6coyc3PxxroTuH1TFQXaZ4GCa3Ou1fdnxeWJuMmXvMFbjp906N6wfocfZ2bK+7aoNWYzK/QTmOZYA/MeQTee8yDLvm9ozfo/b1aAHz8ld/R3x2vFcKv+sTFRO/8nopiW2fT17XZhgdE8mt2v/dLl9GECOgnf6Bqo1wClqOP2pqSynW0Wiy9to5/duoDQAUtd9Caph4vmQZKY3wPTds4r8VtO602TpvWlnOtoqV2X+yXB52qK+Cw8MsX4v7Y+hXz+VsGuwqT1sztGQizre8zEC7NXY/tu9+1eNd12Pva6P0Pk0Y+19uMZynsfXLVxXkQoAOgz3cD0vdqwchBe/TN70Pm7rOjw+EGqAK4IGrvqU9O3UuBA5nHx2lCfuGUozF79XcpS1mvKnER4E+qwQn1Z4JfZRaLpVQtujqPjNc7xKGnXb6BviwKinr/P6Ow7DVf4IGUePRercC6Qo+ZB2ka1F6poxdmuR/hHXf6NGXUa3Fc+of6LlO0JuGiYGmuTZP9sc/RY0u1QNlsrbbxpw2AdAedo7tkIXk9fVeNWKynHY8AbR2kSeunam0uah6lOGi5E9fCPy8+GMxByM4j6wJfp+Tc7j06/KnaAGyyyasa3drY7yMfyppGZ1/3iALyhfbFxjn6K3VcHhX6ORFs1IRJa8H1GQixbcAzECrN3Y7tt98Qz0ozhL2vjd7/wDTyvd5mPEsh75OHrs2DAF2kJ9/zrb/r2O893rX3IVeokBZrVEsikBiiHNm2EfOzYj6/dml2ukC8aqfjb27Q9LxTVamUH6Mh
}
},
"cell_type": "markdown",
"metadata": {},
"source": [
"Был взят 17 вариант, а именно .csv с Ценами на автомобили.![image.png](attachment:image.png)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"# Загрузка (чтение) файла\n",
"df = pd.read_csv('car_price_prediction.csv')\n",
"\n",
"# Сохранение данных в файл\n",
"# df.to_сsv('car_price_prediction.csv', index=False, engine='openpyxl')\n",
"\n",
"# Получение сведений о df\n",
"df.info()\n",
"\n",
"# Получение информации о колонках df\n",
"print(df.columns)\n",
"\n",
"# Вывод отдельных строк/столбцов df\n",
"print(df[0:3])\n",
"print(df.loc[50,\"Price\"])\n",
"\n",
"# Группировка и агрегация\n",
"grouped = df.groupby([\"Price\", \"Model\"])\n",
"print(grouped)\n",
"df[\"Price\"].agg(['sum', 'mean'])\n",
"\n",
"# Сортировка данных в df\n",
"df.sort_values(by=\"Price\", ascending=False)\n",
"\n",
"# Удаление строк/стобцов из df\n",
"df.drop(labels=[2,3], axis=0)\n",
"df.drop(\"Price\", axis=1)\n",
"\n",
"# Cоздание новых столбцов на основе данных из существующих столбцов датафрейма\n",
"df = df.assign(Test = df[\"Fuel type\"] + df[\"Engine volume\"])\n",
"print(df)\n",
"\n",
"# Удаление строк с пустыми значениями\n",
"df_cleaned = df.dropna()\n",
"\n",
"# Удаление только строк, в которых все значения NaN\n",
"df_cleaned = df.dropna(how=\"all\")\n",
"\n",
"# Заполнение пустых значений на основе существующих данных\n",
"median_value = df[\"Price\"].median()\n",
"df[\"Price\"].fillna(median_value, inplace=False)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0.5, 1.0, 'test')"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAn8AAAHHCAYAAADOPz5+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAACmMUlEQVR4nOzdd1zU9R/A8dex9x4ulKmIW9RUzJGallvLrDS1YallVlqu3Ksyy1Kz4S9He7hKzT0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kmTJvHOO++gVCrp1KkTycnJBAYGYmNjw8iRI4u9XmZmJpMnT+aZZ57Bw8ODa9euceLECYYMGQIUzP/7448/OHz4MPb29ixdupSYmBidSf4AejetzVfDW2vU+asldf6EEEIIrdC75M/T05ODBw8yffp0evToQU5ODr6+vvz+++/qYdryevHFF1mwYAENGjQgICCgyLl58+bh7OzMokWLCA8Px87OjtatWzNt2rQSr2doaEhCQgIvvfQSMTExODk5MXjwYPXijBkzZhAeHk6vXr2wsLBgzJgxDBw4sNhhbW3q3bQ2Pf1q4TVtGwBz+vsxvL279PgJIYQQWqBQqVRSZE0UkZKSgq2tLcnJydjY2FTYdd2nbAXgz7Ed8G8g8/yEEEKIivSw79+y2lcIIYQQQo9I8ieEEEIIoUck+RNCCCGE0COS/AkhhBBC6BFJ/oQQQggh9Igkf0IIIYQQekSSPyGEEEIIPSLJnxBCCCGEHpHkTwghhBBCj0jyJ4QQQgihRyT5E0IIIYT
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Визуализация линейчатая\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv('car_price_prediction.csv', nrows=50)\n",
"\n",
"\n",
"x = df[\"Cylinders\"]\n",
"y = df[\"Category\"]\n",
"\n",
"plt.plot(x, y, marker='o')\n",
"\n",
"plt.xlabel('Количество цилиндров')\n",
"plt.ylabel('Категория авто')\n",
"plt.title('test')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<BarContainer object of 100 artists>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmsAAAGdCAYAAABNbzR9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMA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Zo11blzZy1fvlzLli1T586dVaNGjT88rmnTptavTSaTateurfPnzxfZtnnz5goMDLReXUtOTtb58+fVs2dPa5utW7fqgQceUN26deXq6qq+ffvqwoULunr1qrVNlSpVrEFNkjw9PYsdU5Li4+OVlZVlXU6dOvWH5wUAAEqnMhvWpF9uhS5fvlwrVqzQwIEDS3RMhQoVbNZNJpMKCgqKbR8TE2MNa6tXr1anTp1UvXp1Sb884/bwww+radOmWr9+vfbs2aNFixZJknJzc286psViKXZMs9ksNzc3mwUAAJRNZTqsderUSbm5ucrLy1N0dPQdGePJJ5/UgQMHtGfPHr333nuKiYmx7tuzZ48KCgo0e/ZstWnTRgEBATp9+vQdqQMAAJRNZfaZNemXj9rIyMiwfn0n+Pj4qG3btho0aJDy8/P1yCOPWPf5+fkpLy9PCxYsUJcuXZSSkqIlS5bckToAAEDZVKavrEm6K7cJY2JitG/fPnXv3l2VK1e2bm/WrJnmzJmj6dOnq0mTJlq1apUSEhLuaC0AAKBsMVlu9nAUSoXs7Gy5u7srKyuL59dgd7wbtHh3e25Ky7wA5VVJ/36X+StrAAA
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Столбчатая \n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"x = df[\"Airbags\"]\n",
"y = df[\"Category\"]\n",
"\n",
"plt.bar(x,y)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Axes: ylabel='Frequency'>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGdCAYAAAD60sxaAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAAC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Mnn/+eT388MMaNWqUJOmVV15RVFSUVq5cqVtvvdX3JwYAwAVixIgRys7OVmVlpVavXq2pU6cqKChImZmZbv2qqqoUHBysDh06NFOljeNXc4DKysokSRdffLEkaceOHaqurlZKSoqrT8+ePdWpUydt3ry5zjEKCgpUXFzstk94eLiSkpLq3aeyslIOh8NtAQAAkt1uV3R0tDp37qx7771XKSkpevvttzVp0iSNHj1aTz31lGJjY13TV+Lj4/X888+79i8tLdU999yjqKgohYSEqHfv3nr33Xdd2zdu3Khhw4YpNDRUcXFxuv/++92eBPmK33wPkNPp1IwZM3TVVVepd+/ekqTi4mIFBwcrIiLCrW9UVJSKi4vrHOds+4/nCDW0T1ZWlh5//PHzPINzV9cz36Z4LgsAwPkKDQ3ViRMnJEl5eXkKCwvTmjVr6uzrdDqVlpamkydP6tVXX1XXrl21Z88eBQQESJIOHDigESNG6Mknn9SSJUv07bffatq0aZo2bZqys7N9eh5+E4CmTp2q3bt3a+PGjU1+7MzMTGVkZLjWHQ6H4uLimrwOAAD8lTFGeXl5ev/993Xffffp22+/VZs2bfR///d/9f4sxYcffqht27bpiy++UPfu3SVJXbp0cW3PysrS+PHjXROmExMT9eKLL+qaa67RokWLzuuLDn+KXzwCmzZtmt59912tW7dOHTt2dLVHR0erqqpKpaWlbv1LSkoUHR1d51hn20tKSs55H7vdrrCwMLcFAABI7777ri666CKFhIQoLS1N48aN02OPPSZJ6tOnT4O/yZWfn6+OHTu6ws+P7dq1Szk5ObroootcS2pqquvnQ3ypWe8AGWN033336c0339T69euVkJDgtn3QoEEKCgpSXl6ebr75ZknS3r17VVhYqOTk5DrHTEhIUHR0tPLy8tS/f39JP9zR2bp1q+69916fng8AABea6667TosWLVJwcLBiY2MVGPif6NCmTZsG9w0NDW1we3l5ue655x7df//9tbZ16tTJs4LPUbMGoKlTp2rp0qV666231LZtW9ccnfDwcIWGhio8PFxTpkxRRkaGLr74YoWFhem+++5TcnKy2xtgPXv2VFZWlsaMGSObzaYZM2boySefVGJiohISE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7KyUg6Hw20BAAAXrhYTgF5++WW1bdtWN910U4P9kpKSlJOTo9zcXC1atEgFBQUaNmyYTp48We8+WVlZCg8Pdy1xcXHeLh8AAPiRFhOAlixZovHjxyskJKTBfmlpaRo7dqz69u2r1NRUrV69WqWlpXrjjTfq3SczM1NlZWWu5fDhw94uHwAA+JFmnQN0rv75z39q7969ev311xu9b0REhLp37679+/fX28dut8tut59PiQAAoAVpEXeAXnrpJQ0aNEj9+vVr9L7l5eU6cOCAYmJifFAZAABoiZo1AJWXlys/P1/5+fmSpIKCAuXn57tNWnY4HFq+fLnuvPPOOscYPny4FixY4FqfOXOmNmzYoIMHD2rTpk0aM2aMAgIClJ6e7tNzAQAALUezPgLbvn27rrvuOtd6RkaGJGnixInKycmRJC1btkzGmHoDzIEDB3T8+HHX+pEjR5Senq4TJ06oQ4cOGjp0qLZs2aIOHTr47kQAAECLYjPGmOYuwt84HA6Fh4errKxMYWFhXh8/fvaqWm0H5430+nEAALCSxvz9bhFzgAAAALyJAAQAACyHAAQAACyHAAQAACyHAAQAACyHAAQ
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Гистограмма\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"df.plot.hist(column=[\"Price\"], bins=80)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<function matplotlib.pyplot.show(close=None, block=None)>"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAApIAAAIoCAYAAADa2Qt1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAoh0l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TFz5sw4//zz46KLLqqybf78+dGgQYN13v/II4+MoUOHxi233BLnnXdelXi97bbbYsWKFXHiiSfmb5s2bVqcccYZ0bJly/jb3/4W7dq1y2/LsqzKI5sHHHBAzJs3b405/OlPf4oBAwbEddddFxdccMEaczr00EPj1ltvjd/97ndRt27diIj4+OOP4957743DDjss7r///vV+XyIihg0bFkuWLInvfve7MXXq1GrdB9j8eUQS2CD169ePm2++OcrKyqJ///5x2GGHxbnnnhsjRoyIESNGxM0331zrc/rd734X8+fPj6uvvnq9Y2+88cY466yz4uCDD4477rij2o+6zZs3LyZMmBA777zzWh95a968eZSUrPv/5vXq1YsBAwbErFmz4qmnnqqy7ZZbbonS0tI47rjj8reNHTs2Kisr4/e//32ViIz459PLrVq1yn9dXl6+1pA97rjjolGjRvHEE0+sdU4nn3xyfPzxx1Ue3bzllluipKQkBgwYsM7zWW3atGlx0003xS9+8YvYfffdq3UfYMsgJIENdtRRR8Xbb78dZ5xxRjz22GNx6aWXxsiRI2PkyJG1/kabt956K6655pr46U9/Gj169Fjn2D//+c8xePDgiIg4//zz84/AVcfkyZMjy7LYf//9o06dOsnzPemkkyIi4qabbsrfNmXKlHj11VejX79+0bRp0/ztL730UkREHHTQQdXa94QJE6J3796x/fbb5z+SqaioKCoqKmLOnDlrvU/Hjh3jgAMOiBtvvDEi/vla07Fjx8YxxxwTTZo0qdZxhw4dGg0aNFjjUVpgyyckgSStWrWKgw46KL744ovo0qVLfPHFF5Fl2RpvFKlpp59+etSpUycuvfTS9Y494YQTYs8994xtttkmBg4cGJ9//nm1j7P6NYY77LBD8lwj/hlu3//+9+P++++PRYsWRUTkH8X996e1Vx8zl8tFy5Yt17vf0aNHR79+/eLVV1+Ngw46KM4888wYPnx4DB8+PBo3brzOcx00aFBMnDgxXn/99XjkkUdi9uzZMWjQoGqdz9133x3PPPNMDB8+PLbffvtq3QfYcniNJJBk+fLlMWjQoCgqKoqbbrrpGz1Kl+rRRx+Nhx9+OC688MJo3br1esd36dIlnnji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Qw+tEZLFxcXV+rifdfnZz34W9913X/zhD3+IPn36xMEHH7zO8c2aNYsXXnghrrjiirj77rvjuuuui3r16kX79u3j3HPPjW222abax955552jR48e8fzzz6/xJpt/d8opp0Tnzp1j9OjR8cgjj8SyZcuivLw89t577zjqqKPy40aNGhVNmzaN8ePHxw033JD/YPIRI0ZE586dqz2vDXHaaafFLrvsUiP7BjYPuay6vxcMoADGjx8fJ5xwQrV/heHm4rPPPovWrVtHgwYNYtasWdX+UHSATYmfXAAFMG7cuFi0aFEMHDhQRAKbLU9tA5u0XXfdNQYOHFjoaWw0l1xySXz88ccxduzYKC8vz39AOsDmyFPbALUol8tFnTp1Yvfdd49rr7029tlnn0JPCSCZRyQBapH/uwNbEi/MAQAgiZAEACBJrT+1XVlZGXPmzImGDRtGLper7cMDALAeWZbF0qVLo1WrVuv8ZIlaD8k5c+ZEmzZtavuwAABsoA8++CBat279tdtrPSRX/zq1Dz7
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# box\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"plt.figure(figsize=(8,6))\n",
"plt.boxplot(df[\"Price\"], vert=False, patch_artist=True, boxprops=dict(facecolor='lightblue'))\n",
"plt.title('Ящик с усами', fontsize=14)\n",
"plt.xlabel('Цена', fontsize=12)\n",
"plt.show"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA24AAAIpCAYAAADae2sHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAACuxklEQVR4nOzdeXhTVfoH8G/2NG3TBbrShX3fBBSqgCAIKi4oKIgLIooi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VlZmt6+srEzIz89v8BjiY95zzz2CxWKxbT9y5IigVquF4OBgoaioSBAE+7/HlClTBLPZbGufmJgoBAcHCxqNxuG1cM899wgAhNTUVNs28XjTp0+3a5uUlFTr/sXFxUK/fv2EoKAgobS01LY9KytL8Pf3F/z9/YUjR47Uul96errD5y3+/ZYuXer4xAiCcOWVVwoAah3X0fXbnOth+vTpAgAhJSXFtu3AgQOCTCaz/X+r2c+lS5c22H+pY8eOCXK5XIiOjrZ7HEGw/v+4cOFCrWOr1Wrhzz//tGs3bdo0AYDw2muv2bbn5eUJer1e6NChg93fVxAE4bPPPhMACHPnzq3Vp8rKSgGAMGrUqAbPhyAIwrXXXivU9VZd198zLCxM0Gg0wsWLF+22i89R+n9627ZtAoBarwOC4Pg1sS6Oji0FQLj22mvttp08eVJQKpXCgAEDhLy8PLt9y5cvr3XOG7p+HZ2r7Oxsobi4uFbbjRs3CgCEl156qeEnJzT8+u3oXM2YMUMAICxevNh
"text/plain": [
"<Figure size 1000x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Диаграмма с областями\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"average_price_by_year = df.groupby(\"Prod. year\")[\"Price\"].mean()\n",
"plt.figure(figsize=(10, 6))\n",
"plt.fill_between(\n",
" average_price_by_year.index, average_price_by_year, color=\"skyblue\", alpha=0.5\n",
")\n",
"plt.plot(\n",
" average_price_by_year.index, average_price_by_year, color=\"Slateblue\", linewidth=2\n",
")\n",
"plt.title(\"Диаграмма с областями: средняя цена по годам выпуска\", fontsize=14)\n",
"plt.xlabel(\"Год выпуска\", fontsize=12)\n",
"plt.ylabel(\"Средняя цена\", fontsize=12)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAIpCAY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oUaOGUKlU4uDBgwXWY6698vvf//4nAIgPP/xQ6PV6ebpOpxOtWrUSjo6ORtuF4XP36NFD+Pr6Gn2WhIQE4ejoKO9f+dvMnBdeeEEAEDExMfK0wtq/sGPO+vXrBQAxZswYo+nWHgMLW68peb83g5SUFNG4cWPh4eEhUlNTC32vqW0xL2u/H4P27duL/GGJqc+k0+nkY8Ldu3eNypvatwpjatk5OTmiUaNGomrVqsLf379A+xfG3P8TU99lUlKS0Gq1Ijg42Gj7EUKIpUuXCgBi5MiR8rTiHFfu3LljdNwz2Lp1q1Cr1eLVV1+16PORhOkZVCYSExNhb28PrVZb7GXEx8fjk08+Qbdu3fDUU08VmK/RaBAcHFxgesOGDdG5c2fs3LnTZGqEpTw9PfH+++8bTYuIiECXLl1w8uRJo97AatWqFejdValUGDFiBAAYXSbNa/jw4Vi/fj1iY2PlabNnz0ZYWBiaNm1aaN2aNWuGdu3aYfbs2fK0q1evYu3atRg+fLjJ9wQHB8PR0bHAdEMPUGF1LMxLL72EJk2ayH+rVCp8+umnsLOzK3DJskaNGgXeHxgYiF69euHcuXO4fPmyPH3u3LnQ6/X4+OOPC1zeVKlUCAoKkv/+4YcfYGdnh9mzZ8PZ2dmorLOzs3z1ICkpCcuXL8ejjz6KV1991aicn58fxo8fj8TERKM2SEtLAwA0aNDAgtYoHVOnTsWNGzcK7YW
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Диаграмма рассеяния\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"# Построение диаграммы рассеяния (scatter) для объема двигателя и цены\n",
"plt.figure(figsize=(8, 6))\n",
"plt.scatter(df[\"Engine volume\"], df[\"Price\"], alpha=0.5, color=\"coral\")\n",
"plt.title(\"Диаграмма рассеяния: объем двигателя и цена\", fontsize=14)\n",
"plt.xlabel(\"Объем двигателя (л)\", fontsize=12)\n",
"plt.ylabel(\"Цена\", fontsize=12)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnwAAAKUCAYAAACe+uW5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/GU6VOAAAACXBIWXMAAA9hAAAPYQGoP6dpAACq6UlEQVR4nOzdd3hTZfsH8G9Gk+69S+mi7L2VLSgqKii4t6LAq+Lgh7hx4N57oAIOFFRQ9l5lU0ZbWtrSvXfSNHuc8/ujthKaJmlGT5Len+vyel+S55xzJ82484z74bEsy4IQQgghhHgsPtcBEEIIIYQQ56KEjxBCCCHEw1HCRwghhBDi4SjhI4QQQgjxcJTwEUIIIYR4OEr4CCGEEEI8HCV8hBBCCCEejhI+QgghhBAPRwkfIYQQQoiHE3IdACGEuIuamhocPnwYtbW1qK+vR0NDA5YuXYqEhASuQyOEELMo4SOEEAvy8/PxxBNPYM+ePWAYpv12Pp+PsWPH4r777uMwOuu0tLQgMDAQ+fn5SE1NBQC88soryM7Oxl9//cVxdIQQZ6OEr5uUlJQgKSnJ6DYvLy9ERUVh0qRJeO655zB06FCOoiOEdCY/Px9XXHEFZDIZli1bhoceeggpKSng8Xhch9YlAQEBGDVqFGbMmIHbbrsNjY2N+OWXX/Dxxx9zHRohpBvwWJZluQ6iJ2hL+FJSUnDPPfcAAORyOY4fP44jR45ALBZj7969mDBhAseREkIuNWnSJJw4cQKbN2/GzJkzuQ7HLvn5+Xj88cdx/Phx+Pv74+6778Y777wDgUDAdWiEECejhK+btCV8M2fOxI4dO4zue+mll/Dmm29iypQpOHDgADcBEkI6yMrKwtChQ7FkyRJ88MEHXIdDCCE2o1W6LuCJJ54AAJw6dar9tvz8fDz77LMYOXIkwsLC4O3tjb59++K5556DXC43eZ6Wlha89tprGDp0KHx9fREUFIQRI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jYG2+8kQXApqend7jG3XffzQJgS0pK2m9r+/vcf//97bdptVo2MTGRDQgIYM+cOWN0jrS0NFYgEHR43LY+t8uXL2+/Ta/Xs4MHD2Z79erFRkVFsQkJCUbneeGFF1gA7Msvv8wyDNN+u0wmY0ePHs2KRCK2srLSZAyXkkqlbGNjY4fb9+3bx/L5fHb+/PkW42dZlv3yyy9ZAOwnn3zS6bUSEhI6PI5Ltb2u7777bqPHdObMGVYkErHBwcGsTCbrEMvs2bNZLy8vtqampv0+jUbDRkZGsnPmzOnwNzUYDGxKSgoLoMNrc+nSpSwA9qGHHupwHQDs1q1bjdp/8MEHJl/7ph7rO++8wwJgR40aZfI5ZFmWXblyJQuAXb16tcXz3XXXXSwAduXKlUa319bWsvHx8WxERASrUqnab58yZUqH99Xvv/9uFNPl76/OmPtbmnqvFhQUsEKhkI2MjGTLysrab1er1e3v959++smmaz/xxBMsAHbx4sUm2xcVFXW4raqqio2NjWVTU1M7vY6pz4PLOeJvYIqt7wWRSMRmZGS0384wTHuMH3zwgcXHdu2117J+fn5sv379OsTZ9h439Tyb+sxr+zsNGzaMvemmm4zu+/vvv1kA7e9PU+8F4hw0pNvNCgoK8Oqrr+LVV1/F0qVLMXnyZLz++uvw9vbGm2++2d4uLi6u/RfUpdp6bvbs2dN+W01NDTZs2ICUlBSTQ4NRUVEQCu3vzO3bty8eeeQRo9seeeQRpKamYuvWre29IWfPnsXRo0dx//33d5jk3naOrKwsk0O7KpXK5OM25YsvvoCfnx++/PJLo1+vIpGo/bn87bffOhzXNrwtFovNnn/Lli0oKSnB0qVLMWLECKP7Jk6ciNmzZ2Pbtm2QyWRWxWu
"text/plain": [
"<Figure size 800x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Круговая диаграмма\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"car_price_prediction.csv\", nrows=100)\n",
"\n",
"category_counts = df[\"Category\"].value_counts()\n",
"\n",
"plt.figure(figsize=(8, 8))\n",
"plt.pie(\n",
" category_counts,\n",
" autopct=\"%1.1f%%\",\n",
" startangle=140,\n",
")\n",
"plt.title(\"Распределение автомобилей по категориям\", fontsize=14)\n",
"plt.show()"
]
}
],
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}