164 lines
166 KiB
Plaintext
164 lines
166 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Lab1 PIbd-31 MalafeevL.S.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"*Загружаем датасет по варианту*"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 16,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import pandas as pd\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"df = pd.read_csv(\".//datasetlab1//marketing_campaign.csv\", sep=\"\\t\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"*Создаём первую диаграмму. Распеределяет по годам рождения клиентов*"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 17,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1wAAAIjCAYAAAAX5hpkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABouElEQVR4nO3de5xNZf//8ffeY8yJTYOZIeM4ySGnHCdFOQyTSNx3iSIp3e4h4lbpphySSrdDke66i/qWylRUEoYcSggZOUxybMhhDM0MZsxpr98fmv2zzXGPveyZ8Xo+HvNgr7X2tT5rzbUP71lrXctiGIYhAAAAAIDbWT1dAAAAAACUVQQuAAAAADAJgQsAAAAATELgAgAAAACTELgAAAAAwCQELgAAAAAwCYELAAAAAExC4AIAAAAAkxC4AAAAAMAkBC4AAAAAMAmBC7jOLFy4UBaLxfHj6+urBg0aaMSIETp16pSnywMAAChTynm6AACeMWXKFNWtW1cXL17UDz/8oPnz52v58uXavXu3/P39PV0eAABAmUDgAq5TkZGRat26tSTpscceU5UqVTRz5kx9+eWXevDBBz1cHQAAQNnAKYUAJEmdO3eWJB0+fFiSdPbsWf3rX/9S06ZNVaFCBdlsNkVGRmrnzp25nnvx4kVNmjRJDRo0kK+vr6pXr66+ffvq4MGDkqQjR444ncZ45c+dd97paGvdunWyWCz69NNP9dxzzykkJEQBAQHq3bu3jh49mmvdW7ZsUY8ePVSpUiX5+/urU6dO2rhxY57beOedd+a5/kmTJuVa9sMPP1SrVq3k5+enwMBA9e/fP8/1F7Rtl7Pb7Zo9e7aaNGkiX19fBQcH64knntCff/7ptFydOnV0zz335FrPiBEjcrWZV+0zZszItU8lKT09XS+88ILCwsLk4+Oj0NBQPf3000pPT89zX10uv/2W83PkyBGn5d988001adJEPj4+qlGjhqKiopSUlFToeiZNmpRn++XKOf9tMDo62vG7qVq1qh566CH98ccfebZZp06dPNtcuHCh03KvvfaabrvtNlWpUkV+fn5q1aqVPvvss1zt5Tx/9uzZueY1bNhQFotFI0aMKHA7c/rMa6+9plmzZql27dry8/NTp06dtHv37lzLf/fdd7rjjjsUEBCgypUr695771VcXJzTMuPHj5evr69T3895La1bt84xbePGjfL19dX48eNzrcfdr48777xTt9xyS67nvvbaa7n6TZ06dfTII484LRcdHS2LxaI6deo4TU9ISNDQoUNVq1YteXl5OeqsUKFCrnVdKa/1DBs2TL6+vk77Sfr/++/Kn8vryWsfS1LPnj3z3Hd//PGHHn30UQUHB8vHx0dNmjTRe++9l+d68+p/FSpUcNR/5enhhfXzovSjK1+DFStWVNu2bbV06dL8dimAIuAIFwBJcoSjKlWqSJIOHTqkpUuX6u9//7vq1q2rU6dO6b///a86deqkvXv3qkaNGpKk7Oxs3XPPPVqzZo369++vUaNG6dy5c4qJidHu3btVv359xzoefPBB3X333U7rzeuLnyRNmzZNFotFzzzzjBISEjR79mx17dpVsbGx8vPzk3TpC0RkZKRatWqlF154QVarVQsWLFDnzp31/fffq23btrnarVmzpqZPny5JOn/+vIYPH57nuidOnKj7779fjz32mE6fPq033nhDHTt21I4dO1S5cuVczxk2bJjuuOMOSdIXX3yhJUuWOM1/4okntHDhQg0ZMkRPPvmkDh8+rLlz52rHjh3auHGjvL2989wPrkhKSnJs2+Xsdrt69+6tH374QcOGDVOjRo20a9cuzZo1S7/99luRvkxdvt9yLF++XB9//LHTtEmTJmny5Mnq2rWrhg8frn379mn+/PnaunVrkbdz/vz5Tl+erdb//7fBnH3Ypk0bTZ8+XadOndKcOXO0cePGfH83LVq00NixYyVd+oPC888/n2uZOXPmqHfv3ho4cKAyMjL0ySef6O9//7uWLVumnj17Oi3r6+urBQsWaPTo0Y5pP/74o37//fdCt+1yH3zwgc6dO6eoqChdvHhRc+bMUefOnbVr1y4FBwdLklavXq3IyEjVq1dPkyZNUlpamt544w116NBBP//8s+PL/0svvaT9+/frvvvu05YtW1S3bt1c6zt8+LD69Omje+65Ry+99FKeNZn1+nBVVlaW/v3vf+c5b/DgwVq9erVGjhyp5s2by8vLS2+//bZ+/vlnl9fzwgsv6N1339Wnn36a648UOZ577jk1atRIkvT2228rPj6+wDY3bNig5cuX55p+6tQptW/f3hHKq1Wrpm+//VZDhw5VSkqKU38qio4dO+r//u//HI+nTZsmSU777bbbbpNU9H6UI6fdxMREvfnmm/r73/+u3bt36+abb3apRgB/MQBcVxYsWGBIMlavXm2cPn3aOHr0qPHJJ58YVapUMfz8/Ixjx44ZhmEYFy9eNLKzs52ee/jwYcPHx8eYMmWKY9p7771nSDJmzpyZa112u93xPEnGjBkzci3TpEkTo1OnTo7Ha9euNSQZN954o5GSkuKYvnjxYkOSMWfOHEfbN910k9G9e3fHegzDMFJTU426desa3bp1y7Wu2267zbjlllscj0+fPm1IMl544QXHtCNHjhheXl7GtGnTnJ67a9cuo1y5crmm79+/35BkvP/++45pL7zwgnH52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ZMgQl7anT58+jtebJLVt21bt2rVz9PETJ04oNjZWjzzyiAIDAx3LNWvWTN26dct1FMXf319ff/21zp49q/vvv1/Z2dmSLr1+H3jgAf3555/66quvnLb1cma8PrKzs3P15dTU1ALXkZqaqilTpmjEiBGqVauW07wLFy7Ibrc7jsQX15dffql//vOfGjduXL6ngBbltX2lL774Qlu3btXLL7/sNN0wDH3++efq1auXDMNw2h/du3dXcnJyrr5
|
||
|
"text/plain": [
|
||
|
"<Figure size 1000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=(10, 6))\n",
|
||
|
"plt.hist(df['Year_Birth'], bins=20, color='lightblue', edgecolor='black')\n",
|
||
|
"plt.title('Распределение по годам рождения клиентов')\n",
|
||
|
"plt.xlabel('Год рождения')\n",
|
||
|
"plt.ylabel('Количество клиентов')\n",
|
||
|
"plt.grid(True)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"*Вторая диаграмма. Столбчатая диаграмма расходов на вина, фрукты и мясо*"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 18,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2wAAAKOCAYAAADal5psAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB/5ElEQVR4nOzde3zO9eP/8ed1zU4Om/OcZoZyPgtTORQbVigpJRaiNDmsKH36OHUQfZz6UD6+YXSQSCp8MKdUhiJnKjXR2JzNYefr/fuj366Py4ZN295v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t2rPM6DzzwgHP677//btjtduPxxx83JBmnTp1yzrty5Uq2jM8884xRtGhRIyUlxTmtbdu2hiRjypQpzmmpqalG48aNjfLlyxtpaWmGYRjGxo0bDUnGkiVLsi23WLFiRkREhPPy/PnzDUnG999/f93Hq23btkbbtm2dlz/44APDbrcb33zzjcu42bNnG5KM77777rrLysv9yMjIMFJTU12ue+7cOSMgIMDo37+/c9qGDRsMScbQoUOz3ZbD4XD+/8SJE0bp0qWNjh07GqmpqUaTJk2MqlWrGhcuXHCOWb58uSHJeP31112W88gjjxg2m804fPiwy/S1a9cakoylS5c6p0VGRhrX/vrLel1c/bxfKygoyOW5yUnWa/Lq11yWevXquTxPuX388pLniSeeMIoWLZotz/z5853THn30UaN+/fpGYGBgrl5rp06dMiQZY8eOdU7L6T0RGxtrSDIWLlx40+zXSklJMcqXL288/vjjzmm7d+82PDw8jEaNGjkfp9OnTxslSpQwhg0b5hwXERFhSDKef/555zSHw2GEh4cbXl5ezuf0p59+MiQZ7733nsttd+3a1ahWrZrztZj1/ty4caORkpJitGvXzihfvny219bVIiIijKCgoBzn5fdrKzfP5Y2un5f15X/+8x9DkhEbG+uyLElGZGSk83Lfvn0Nu92e43oq63EdPny4IcllvXTx4kUjODjYqFatmpGZmXnD/IA7Y5dIAAUuKSlJklSiRIlcjff391e3bt20aNEi5y5NmZmZWrx4sbp3765ixYq5jG/atKnq1avn/Iv377//ro0bN95wF6H+/ftr9erVSkhIkCQtWLBAISEhuvPOO7ON9fX1df7/4sWLOn36tO69915duXJFhw4dchlbpEgR565VkuTl5aVnnnlGJ0+e1I4dO1zGZi3r6p/ruXDhgk6fPq2LFy9ed0yWJUuWqE6dOqpdu7bLsu+77z5JytUud7m5Hx4eHvLy8pL051a9s2fPKiMjQ82bN9fOnTud1/3ss89ks9k0duzYbLdz9a6JFSpU0KxZsxQTE6N7771Xu3bt0rx58+Tn5+ccs2rVKnl4eGjo0KEuy3nhhRdkGEa23eWythr4+Pjc9D5L0tmzZ3X69Gldvnw5V+Ov58qVK9me22t3oc3t43cjqampOn36tE6ePKmYmBht2LBB999//3XH79ixQ0uWLNHEiRNlt+f8ESDrtZb1c/bs2Wxjrn5PpKen68yZM6pZs6ZKliyZ6+xX27t3r06ePKmHH37YOa1hw4by8fFR48aNnY9TmTJl1KZNG61fvz7bMq7eRS9rl720tDStW7dOknTnnXeqZcuW+uijj5zjzp49q//+97/q3bt3tt1kHQ6H+vbtq61bt2rVqlWqUaNGnu/X1fLrtZUlN89lTvKyvsxa35QpU+a6y3M4HFq+fLkefPBBNW/ePNv8rMd11apVatGihe655x7nvOLFi2vQoEE6cuSIDhw4kOv7ALgbChuAApf1gTs3ZSNL3759dfToUeeuXevWrVNiYmK2XXGy9OvXT/Pnz5f05y6
|
||
|
"text/plain": [
|
||
|
"<Figure size 1000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"categories = ['MntWines', 'MntFruits', 'MntMeatProducts']\n",
|
||
|
"total_spent = df[categories].sum()\n",
|
||
|
"plt.figure(figsize=(10, 6))\n",
|
||
|
"total_spent.plot(kind='bar', color=['purple', 'green', 'red'], edgecolor='black')\n",
|
||
|
"plt.title('Суммарные расходы на вина, фрукты и мясо')\n",
|
||
|
"plt.xlabel('Категории продуктов')\n",
|
||
|
"plt.ylabel('Суммарные расходы')\n",
|
||
|
"plt.grid(True)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"*Третья диаграмма. Срез данных до 30 строки. Расходы также на вино, фрукты и мясо, но первые 30 строк*"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 19,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<Figure size 1000x600 with 0 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmsAAAHHCAYAAADgeh/sAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD780lEQVR4nOydd3xT5f7HPyerSfde0JayZVMUBJlSKFNQvP4AkXnFAaKigKiX5QBREVTcLAXFAaIiYssShcq0bJlld++VZp3fH+lzmjRJm6RZpd/3ffVKznzOk5OTT76T43meB0EQBEEQBOGRiNw9AIIgCIIgCMIyJNYIgiAIgiA8GBJrBEEQBEEQHgyJNYIgCIIgCA+GxBpBEARBEIQHQ2KNIAiCIAjCgyGxRhAEQRAE4cGQWCMIgiAIgvBgSKwRBEEQBEF4MCTWCIIgrOTGjRuQy+U4cOCAu4dCEEQD45NPPkFsbCwqKytt3tcjxdr69evBcZzwJ5fL0bp1a8ycORNZWVnuHh7RSMjNzQXHcVi0aJG7h0J4CEuWLEGPHj1w3333uXsoBOF2bt++jQkTJqBNmzbw8/NDYGAgunfvjg0bNsBcJ8tbt27hkUceQWBgIPz9/TFq1ChcuXLFDSN3D5MnT4ZKpcKnn35q874SJ4zHYSxZsgTx8fFQKpX466+/8PHHH2PHjh04ffo0vL293T08giAaETk5OdiwYQM2bNjg7qEQhEeQm5uLmzdv4uGHH0ZsbCzUajVSUlIwefJknD9/Hm+++aawbWlpKQYMGICioiK8/PLLkEqleO+999CvXz+kpaUhJCTEjVfiGuRyOSZNmoQVK1bgmWeeAcdx1u/MeyDr1q3jAfBHjhwxWj579mweAP/111+7aWREYyInJ4cHwC9cuNDdQyE8gBUrVvAKhYIvKSlx91AIwqMZMWIE7+Pjw2s0GmHZW2+9xQPgDx8+LCw7d+4cLxaL+fnz57tjmG7h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5vb28EBQWhb9++SE5OFs5Z23vEvnMN79X33nsPcXFxUCgU6Nevn8l8AsCePXuEuQkMDMSoUaNM7i323WXI3r174eXlhSeffNJoebdu3RAcHIyffvrJqmtmeLQbtCbsQ8XMpVeuXMG2bdvwn//8B/Hx8cjKysKnn36Kfv364ezZs4iOjgYAaLVajBgxArt378bYsWPx7LPPoqSkBCkpKTh9+jRatGiBV199Fb/88gumTZuGU6dOwc/PD7///js+//xzvPbaa+jcuTMAoKKiAv3798elS5cwc+ZMxMfH4/vvv8fkyZNRWFho9ssYqHbpAsC7775r8uB1B9bOX208+OCDeOihh6DRaJCamorPPvsMFRUV+Oqrryzus3//fuzYsaNeY09JScGVK1cwZcoUREZG4syZM/jss89w5swZ/P3337aZl6t4/vnnsWHDBsycORNNmzbF008/DQD47LPPcP/99+P111/HqlWrMHToUFy5cgV+fn7CvgUFBRg2bBgeeeQRjBs3Dt999x2eeuopyGQyTJ06Fb6+vnjwwQfx7bffYsWKFRCLxcK+33zzDXiex6OPPmp2XDdu3MCQIUPQtm1bfPfdd5BIJOjbt6/RHL/xxhsAYCROevXqZfMc2Io976VcLse6deuMxMyGDRsgk8mgVCqNtk1NTcUjjzyCzp07Y9myZQgICEBubi6ef/55o+1OnjyJPn36QCqVYvr06WjWrBkuX76MX375RZibM2fOoE+fPvD398fcuXMhlUrx6aefon///vjjjz/Qo0cPi2NWq9U4cuQInnrqKZN1KSkpGDFiBKKiovDss88iMjIS586dw/bt242eB1qtFkOGDMG9996L5cuXY+fOnVi4cCE0Gg2WLFkibPfEE09g/fr1mDJlCmbNmoX09HR8+OGH+Oeff3DgwAFIpVJh2+nTpyMyMhK3b9/Ghx9+iMTERKSnp1sdJjJo0CBMnDgRAHDkyBG8//77RuuLi4vxxRdfYNy4cXj88cdRUlKCNWvWICkpCYcPH0aXLl2sOo8rWbVqFfbs2YNJkyYhNTUVYrEYn376KZKTk/HVV18ZPdcGDhwIACbixRKGz3FA/yOs5j2RlZWFe++9VxBOYWFh+O233zBt2jQUFxfjueeeM9r+jTfeAMdxmDdvHrKzs7Fy5UokJiYiLS0NCoVC2K5t27Z45ZVXwPM8Ll++jBUrVmDYsGG4fv26jTNkzFdffYVJkyYhKSkJb731FsrLy/Hxxx+jd+/e+Oeff0wMC+aoqKhAWVkZSktL8ccff2DdunXo2bOnMH6dToeTJ09i6tSpJvt2794dycnJKCkpMXqm1mTx4sVYtGgRevXqhSVLlkAmk+HQoUPYs2cPBg8ejJUrV6K0tBQAcO7cObz55pt4+eWXcddddwGAyY+sL7/8EiUlJZgxYwaUSiVWrVqF+++/H6dOnUJERAQAYNeuXRg6dCiaN2+ORYsWoaKiAh988AHuu+8+HD9+3OLcnDhxAqNHj8awYcOwevVqk/UJCQm2Jyk5w8xXX5gbdNeuXXxOTg5/48YNfvPmzXxISAivUCj4mzdv8jzP80qlktdqtUb7pqen815eXvySJUuEZWvXruUB8CtWrDA5l06nE/596tQpXiaT8f/973/5goICvkmTJvzdd9/Nq9VqYZuVK1fyAPiNGzcKy1QqFd+zZ0/e19eXLy4uNjr+Z599xgPgjx49KiwbPnw4HxcXZ7TdpEmTeB8fn1rnBVa45Pbu3csD4L///nuTdT4+PvykSZOE19bOny3j6dWrF9+uXTuT8ezdu1dY1qNHD37o0KEm+y9cuJAHwOfk5Bgd88iRIzwAft26dcKy8vJyk/F88803PAB+//79dY69JpmZmbxMJjMyx2/fvp0HwA8bNky4T86dO8dzHMe/9957wnb9+vXjAfDvvvuusKyyspLv0qULHx4ezqtUKp7nef7333/nAfC//fab0bk7derE9+vXT3j
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"df_slice = df.iloc[0:30]\n",
|
||
|
"df_slice_expenses = df_slice[['MntWines', 'MntFruits', 'MntMeatProducts']]\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(10, 6))\n",
|
||
|
"df_slice_expenses.plot(kind='line', marker='o')\n",
|
||
|
"plt.title('Расходы на вина, фрукты и мясо (срез данных: первые 30 строк)')\n",
|
||
|
"plt.xlabel('Клиенты (срез)')\n",
|
||
|
"plt.ylabel('Расходы')\n",
|
||
|
"plt.grid(True)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "miivenv",
|
||
|
"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
|
||
|
}
|