201 lines
116 KiB
Plaintext
201 lines
116 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Index(['Unnamed: 0', 'carat', 'cut', 'color', 'clarity', 'depth', 'table',\n",
|
|||
|
" 'price', 'x', 'y', 'z'],\n",
|
|||
|
" dtype='object')\n",
|
|||
|
"Unnamed: 0 6\n",
|
|||
|
"carat 0.24\n",
|
|||
|
"cut Very Good\n",
|
|||
|
"color J\n",
|
|||
|
"clarity VVS2\n",
|
|||
|
"depth 62.8\n",
|
|||
|
"table 57.0\n",
|
|||
|
"price 336\n",
|
|||
|
"x 3.94\n",
|
|||
|
"y 3.96\n",
|
|||
|
"z 2.48\n",
|
|||
|
"Name: 5, dtype: object\n",
|
|||
|
"Группировка по огранке (cut):\n",
|
|||
|
"cut\n",
|
|||
|
"Fair 1610\n",
|
|||
|
"Good 4906\n",
|
|||
|
"Ideal 21551\n",
|
|||
|
"Premium 13793\n",
|
|||
|
"Very Good 12083\n",
|
|||
|
"dtype: int64\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"df = pd.read_csv(\".//static//csv//Diamonds Prices2022.csv\")\n",
|
|||
|
"print(df.columns)\n",
|
|||
|
"print(df.iloc[5])\n",
|
|||
|
"\n",
|
|||
|
"grouped_by_cut = df.groupby('cut').size()\n",
|
|||
|
"print(\"Группировка по огранке (cut):\")\n",
|
|||
|
"print(grouped_by_cut)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"линейная диаграмма\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArwAAAHWCAYAAACVPVriAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACWAElEQVR4nO3deXhTZdoG8DtN9w1KC4VCoSwKokAVBFGgoJRVBPkYFUZBcEBFNjuKICOLMrKICG7g4IC7qFAFBSoFKaAgSFll2IQiUGhpWbpCm6bn++P1JE2TtkmznJPk/l1XryQnJydv3p7lyZN30UiSJIGIiIiIyEP5KF0AIiIiIiJnYsBLRERERB6NAS8REREReTQGvERERETk0RjwEhEREZFHY8BLRERERB6NAS8REREReTQGvERERETk0XyVLgAREdmvtLQUV69eRXl5OWJiYpQuDhGRqjDDS0Tkpvbt24cRI0YgKioKAQEBaNSoEf7v//5P6WJRDcaPH4/ExESli0EeJiUlBaGhocjJyVG6KKrEgNfLLV++HH379kV0dDT8/PzQsGFDJCQk4JNPPkF5ebnSxSOiKqxbtw7dunXD//73P/z73/9GamoqUlNT8cEHHyhdNKpGRkYGPvzwQ7z88stKF0X1bty4gaeeegp33HEH6tSpg9DQUHTo0AFLly6FTqczW//69esYN24c6tevj5CQEPTq1Qv79+9XoOTK6NevH1q1aoV58+YpXRRV0kiSJCldCFJO165d0ahRI9x///0IDw/H9evX8euvv2L16tV49NFH8eWXXypdRCKq5OrVq2jdujXuvfdefPPNN/D391e6SGSlKVOmYNOmTThx4oTSRVG9q1evYsCAAejRowfi4uLg4+ODXbt24bPPPsNjjz2GL774wrBueXk5unfvjkOHDuHFF19EVFQU3n//fZw/fx7p6em45ZZbFPwkrrNs2TK88MILyMrKQlhYmNLFUReJvFppaanF5RMmTJAASBkZGa4tEBHVaNGiRVJoaKh09epVpYtCNigtLZWioqKkf/3rX0oX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AAUlJSMGLECJvPMdYcc0ePHkX37t0RHh6OqVOnws/PDx988AF69uyJ7du3o0uXLha3ff78efTr1w9t2rTB119/DV9f01CuY8eO+O6772qsV6+jdIqZ1KF169YSAMPfyJEjJZ1OZ7JOcXGx2euefvppKTg4WLp586ZhWUJCgpSQkGCy3ssvvywBkC5fvmxYBkCaNWuW4fHUqVOlBg0aSB07djR5/cqVKyUA0uLFi83ev7y8XJIkScrIyJAASKtWrTI898gjj0h33HGHFBsbK40aNcqwfNWqVRIAafjw4VK7du0My4uKiqTw8HBpxIgREgDpt99+kyRJ/AzZoEED6Y477pBu3LhhWP+HH36QAEgzZ840LOvRo4cUFhYm/fnnnxbLWVmzZs1MylZRQkKCdPvtt1t8riZVvfaNN94wa6ry2muvSSEhIdLJkydN1p02bZqk1Wqlc+fOSZJkrOM33njDbLu33367yf9s27ZtZj8vVjZq1CipWbNm1X6Oy5cvS/7+/lKfPn0kvV5vWP7uu+9KAKSVK1eavcbSvlATa/bZs2fPSlqtVvr3v/9tst6RI0ckX19fw/KysjKpefPmUrNmzaRr166ZrFtxP7B0PH355ZcSAGnHjh01lheANHv2bJPlTz75pARAOnLkiGGZfEzv27fPsOzPP/+UAgMDpYcfftiwbNasWVLFS8Lly5elsLAwqX///hIAadu2bSbvderUKQmA9PHHH1e5DdmMGTMkjUZjsqzyvm/L+1uqu3nz5kkajcbk2Bs1apQUEhJitu4333xj8TNJUs3
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 800x500 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"df_subset = df.head(30)\n",
|
|||
|
"\n",
|
|||
|
"plt.figure(figsize=(8, 5))\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(df_subset['price'], df_subset['carat'], marker='o', linestyle='-', color='blue')\n",
|
|||
|
"\n",
|
|||
|
"plt.title('Зависимость цены от веса бриллианта (первые 30 строк)')\n",
|
|||
|
"plt.xlabel('Цена')\n",
|
|||
|
"plt.ylabel('Вес')\n",
|
|||
|
"\n",
|
|||
|
"plt.grid(True)\n",
|
|||
|
"\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Вывод: На данной диаграмме отображается зависимость цены бриллиантов от их веса для первых 30 записей из набора данных. Судя по диаграмме, можно увидеть, что с цена не зависит от веса."
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
" круговая диаграмма"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 6,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAGrCAYAAADn6WHYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABo6klEQVR4nO3dd3hT5dsH8O/J3ulIF21pCy3Q0hak7CF7CSLIkKUCDhS3/twi4gAXoiKiOEDEBYiivIooQ9kge7a0tNC9d5t93j8KldKVtklOcnJ/rqsX5CR5zp1559kMy7IsCCGEkDYScB0AIYQQfqCEQgghxC4ooRBCCLELSiiEEELsghIKIYQQu6CEQgghxC4ooRBCCLELSiiEEELsghIKcUslJSVITk6G2WzmOhRCyFWUUIhbMJlMePvtt9GtWzdIpVJ4e3sjKioKO3bs4Do0QshVTk8oa9euBcMwtX8ymQydOnXCww8/jNzcXGeHQ9yAwWDAiBEjsHDhQgwZMgQbN27En3/+iZ07d6Jfv35ch0cIuUrE1YlfffVVREREQK/XY+/evVi1ahV+++03nDlzBgqFgquwiAt66623cOjQIfzxxx8YMmQI1+EQQhrBWUIZO3YsevbsCQC499574evri/feew9btmzBjBkzuAqLuBiz2Yz3338fTz31FCUTQlycy/ShDBs2DACQmpoKACgqKsL//vc/xMXFQaVSQaPRYOzYsTh58mS9++r1erzyyivo1KkTZDIZgoKCcPvttyMlJQUAkJaWVqeZ7ca/67+odu/eDYZh8MMPP+CFF15AYGAglEolJkyYgPT09HrnPnToEMaMGQOtVguFQoHBgwdj3759DT7GIUOGNHj+V155pd5t169fj4SEBMjlcvj4+GD69OkNnr+px3Y9q9WK999/H127doVMJkNAQADmz5+P4uLiOrcLDw/H+PHj653n4YcfrldmQ7G/88479Z5ToKbZatGiRYiMjIRUKkVoaCieeeYZGAyGBp+raxITE1FcXAy1Wo3BgwdDoVBAq9Vi/PjxOHPmTJ3bvvLKK2AYBhcuXMC0adOg0Wjg6+uLxx57DHq9vtWxA8CcOXNsfu0aez3S0tJafH6j0YiXX34ZCQkJ0Gq1UCqVGDRoEHbt2lXnvtfeB++++269eGJjY2vLvPb+burv+riOHz+OsWPHQqPRQKVSYfjw4Th48GCd8m9sxlYoFIiLi8Pnn39eL5Yb3Xjf5p5fW+JpiK3PzzU3flZ1Oh3GjRtX7z0HNP9Zbexz39Bndc2aNRg2bBj8/f0hlUoRExODVatW1TtneHg4GIbB448/Xu+60aNHg2GYBj/HjsZZDeVG1778fX19AQCXLl3Czz//jKlTpyIiIgK5ubn49NNPMXjwYJw7dw7t2rUDAFgsFowfPx47duzA9OnT8dhjj6G8vBx//vknzpw5g44dO9aeY8aMGbjlllvqnPf5559vMJ433ngDDMPg2WefRV5eHt5//32MGDECJ06cgFwuBwDs3LkTY8eORUJCAhYtWgSBQFD7htizZw969+5dr9yQkBAsXboUAFBRUYEHH3ywwXMvXLgQ06ZNw7333ov8/HysWLECN998M44fPw4vL69697n//vsxaNAgAMDmzZvx008/1bl+/vz5WLt2LebOnYtHH30Uqamp+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717suOjoaVqsV6enp6Nq1a+3xHj161P5fKpXio48+arDZtzVaE09b7d+/v857NioqCj///HPte7Kln1Vb7Nu3D4sWLcKBAwdQVVVV57rS0lJotdo6x+bOnYuEhARkZ2cjKSkJ2dnZmDZtGl5//fUWn9seOEsovXv3rh3l1ZAlS5Zg4cKFmDdvHl577TX4+Ph
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 500x500 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"color_counts = df['color'].value_counts() \n",
|
|||
|
"\n",
|
|||
|
"plt.figure(figsize=(5, 5))\n",
|
|||
|
"plt.pie(color_counts, labels=color_counts.index, autopct='%1.1f%%', colors=plt.cm.Paired(range(len(color_counts))))\n",
|
|||
|
"plt.title('Распределение бриллиантов по цветам')\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Вывод: Из данной диаграммы можем сделать вывод о том, что бриллиантов цвета G самое большое колличество, а с цветом J - самое маленькое."
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"стобчатая диаграмма"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 7,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnsAAAE8CAYAAAC4gXfeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABKRElEQVR4nO3dd1RU19oG8GcoM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iIyMxbdo0rFy5stR2VCoVunTpgsmTJ5e4vyjh0Yc5c+agcePGyM/Px7FjxzB9+nSYmZmV2lOmjaKeLX31vsycORMmJiYIDw/XmPRQRJtrmpaWBhsbG1hbW+vk+P369cOhQ4cQHh6OJk2awMbGBiqVCsHBwRoJP/C059bOzk56/ddff2H06NFliqUiGjVqhLlz5wJ4mlwtXLgQHTt2xMmTJ8v8Xahspf2Mcb1N0hcme0QvwRtvvCH9u2XLlhg9ejQWL16MQYMGSbfKvL29AQDJycnSrckiycnJ0v4iFy5cAPC016osIiIi0KRJE/Tv37/UOpGRkRg2bBguXrwo/eF577331OrUqlULOTk5aoPvS1KrVi3s3LkTGRkZOuvda968uTQbsWvXrrh58yZmzpyJL7/8Es7OzrCyskJycrLG+y5evAgTExN4enqW2raPjw9UKhVSUlLUPlOlUonbt2+jR48eavUvXboEIYTaH+6//voLwNNZlMXdunULCxYsQFRUFGxtbUtN9rS5phcuXCjztX/R8R88eIC4uDhMmzYNU6ZMkcpTUlJKbfONN95Qu3V
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 700x300 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"grouped_by_cut = df.groupby('cut').size()\n",
|
|||
|
"\n",
|
|||
|
"plt.figure(figsize=(7, 3))\n",
|
|||
|
"plt.bar(grouped_by_cut.index, grouped_by_cut.values, color='blue')\n",
|
|||
|
"\n",
|
|||
|
"plt.title('Количество бриллиантов по cut')\n",
|
|||
|
"plt.xlabel('cut')\n",
|
|||
|
"plt.ylabel('Количество бриллиантов')\n",
|
|||
|
"\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"Вывод: На данной диаграмме видно, что бриллиантов с огранкой \"Ideal cut\" больше всего, а бриллиантов с огранкой \"Fair\" - меньше всего."
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"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
|
|||
|
}
|