AIM-PIbd-32-Smirnov-A-A/lab1/lab1.ipynb

207 lines
124 KiB
Plaintext
Raw Permalink Normal View History

2024-10-26 13:38:50 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Начало лабораторной \n",
"\n",
"Выгрузка данных из csv файла в датафрейм"
]
},
{
"cell_type": "code",
2024-10-26 14:00:22 +04:00
"execution_count": 11,
2024-10-26 13:38:50 +04:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Index(['ID', 'Year_Birth', 'Education', 'Marital_Status', 'Income', 'Kidhome',\n",
" 'Teenhome', 'Dt_Customer', 'Recency', 'MntWines', 'MntFruits',\n",
" 'MntMeatProducts', 'MntFishProducts', 'MntSweetProducts',\n",
" 'MntGoldProds', 'NumDealsPurchases', 'NumWebPurchases',\n",
" 'NumCatalogPurchases', 'NumStorePurchases', 'NumWebVisitsMonth',\n",
" 'AcceptedCmp3', 'AcceptedCmp4', 'AcceptedCmp5', 'AcceptedCmp1',\n",
" 'AcceptedCmp2', 'Complain', 'Z_CostContact', 'Z_Revenue', 'Response'],\n",
" dtype='object')\n"
]
}
],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"df = pd.read_csv(\"..//..//static//csv//marketing_campaign.csv\", sep=\"\\t\")\n",
"\n",
"print (df.columns)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-10-26 13:42:05 +04:00
"Эта вывод датасета по столбцам \"Year_Birth\", \"Marital_Status\", \"Income\"."
2024-10-26 13:38:50 +04:00
]
},
{
"cell_type": "code",
2024-10-26 14:00:22 +04:00
"execution_count": 12,
2024-10-26 13:38:50 +04:00
"metadata": {},
2024-10-26 13:42:05 +04:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Year_Birth Marital_Status Income\n",
"0 1957 Single 58138.0\n",
"1 1954 Single 46344.0\n",
"2 1965 Together 71613.0\n",
"3 1984 Together 26646.0\n",
"4 1981 Married 58293.0\n",
"... ... ... ...\n",
"2235 1967 Married 61223.0\n",
"2236 1946 Together 64014.0\n",
"2237 1981 Divorced 56981.0\n",
"2238 1956 Together 69245.0\n",
"2239 1954 Married 52869.0\n",
"\n",
"[2240 rows x 3 columns]\n"
]
}
],
2024-10-26 13:38:50 +04:00
"source": [
2024-10-26 13:42:05 +04:00
"data = df[[\"Year_Birth\", \"Marital_Status\", \"Income\"]].copy()\n",
"print(data)"
2024-10-26 13:38:50 +04:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-10-26 14:00:22 +04:00
"Данная столбчатая диаграмма отображает распределение количества клиентов по годам их рождения. На оси X указаны конкретные годы рождения, а на оси Y — количество клиентов, родившихся в соответствующем году. Анализируя диаграмму, можно сделать выводы о возрастной структуре клиентской базы. Видно, что пик рождаемости среди клиентов приходится на период с 1950 по 1980 годы, что может указывать на преобладание клиентов среднего возраста."
2024-10-26 13:42:05 +04:00
]
},
{
"cell_type": "code",
2024-10-26 14:00:22 +04:00
"execution_count": 16,
2024-10-26 13:42:05 +04:00
"metadata": {},
"outputs": [
{
"data": {
2024-10-26 14:00:22 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+QAAAI5CAYAAAAoivBUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABxIUlEQVR4nO3de3zP9f//8ft7m82GbZg5H4ZpowilWCE5fhSidFCEIpFDPh0UiUgOlUPovOpTfYoOOn0iOXRQyDEyLKa3Qw7vhNgM2/P3h5/319v2nr332rz23m7Xy+V94f16vh6v5+N12Ou9x16v9/PlMMYYAQAAAACASyrA7gQAAAAAACiOKMgBAAAAALABBTkAAAAAADagIAcAAAAAwAYU5AAAAAAA2ICCHAAAAAAAG1CQAwAAAABgAwpyAAAAAABsQEEOAAAAAIANKMgBAAAAALABBTkA5IO33npLDodDa9asydL22muvyeFwqFu3bsrIyLAhOwAAABRGFOQAUIA+/fRTDRo0SNdff70++OADBQYG2p0SAAAACgkKcgAoIMuXL9edd96p+vXr64svvlDJkiXtTgkAAACFCAU5ABSADRs2qGvXrqpcubIWLVqkiIiILPPMnz9fTZs2VWhoqKKionT33Xdr79692S7P4XBk+9q1a5fHPE8//bRH3NSpU+VwONS6dWv3tKeffloOhyNLH7Vq1dK9997rMe3IkSMaPny4qlevrpCQENWtW1eTJ09WZmamx3yZmZmaMWOGrrjiCpUsWVIVKlRQx44d3bfwe8v/3OtcfsuXL/eYHhISonr16mnSpEkyxnj0uX79enXq1Enh4eEqXbq0brzxRq1cuTLb7Xe+Xbt2yeFw6K233nJP++eff9S0aVPFxMTozz//9Jj/3Pa68HX+tspumx4/flyVKlWSw+HQ8uXLPdpWrVqljh07KiIiQmFhYWrVqpVWrFiRbb8ul8tj+po1azzyv/feey+6fc8/TubMmaMGDRooJCREVapU0eDBg3XkyBGPPlq3bu0RHxUVpc6dO2vz5s0X3b4XxuaUS27zyY63/RIUFOQxny8/Z7Vq1cp2mecfK5I0bdo0tWjRQuXLl1doaKiaNm2qjz76KMvyzsVPnz49S1tcXJwcDoeGDBmS43qeO16nTZumF198UTVr1lRoaKhatWqV7f5YunSprr/+epUqVUqRkZHq2rWrkpKSPOYZNWqUSpYs6XHMnfvZO/9YXbFihUqWLKlRo0Zl6cfbfr7wHCRJ7777rnsflCtXTnfccYd2796dZXmXX355lthp06ZlOW6yO1fNnz9fDodDtWrV8ph+8OBB9e/fXzVq1FBgYKA7z9KlS2fpCwDsEHTxWQAAvtixY4c6duyokJAQLVq0SJUrV84yz1tvvaW+ffvq6quv1qRJk3TgwAHNmDFDK1as0Pr16xUZGZkl5pZbblH37t0lST/88INeffXVHPM4cuSIJk2alOf1SE1NVatWrbR3714NHDhQNWrU0E8//aRRo0bpzz//9Cgy+vfvr7feekudOnXSfffdpzNnzuiHH37QypUrddVVV+k///mPe95zub/44ouKioqSJFWsWNGj7yeeeELx8f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5GR4Z7+0ksvGUnmzTffdE9r1aqVxzFjjDFPPPGEkWQOHjyYbb/nxzZo0CDL9KlTp3rsd1/yyY637XOOrz9nxhhTpUoVc9NNN7nfe9vWqampWfq6/PLLTZs2bTymSzK33nqrCQoKMmvWrHFP79+/v7nrrruMJDN48OAc1/Pc8RoaGmr27Nnjnr5q1SojyYwYMcI97corrzTR0dHmr7/+ck/buHGjCQgIML179/ZY7okTJ8xVV11lGjRoYI4ePerxs3fkyBFTv359c/XVV2dZ13NatGhhLr/8cvf7Q4cOZTn2du3aZQIDA83EiRM9Yjdt2mSCgoI8puf2uDEm68/fnDlzTEhIiLnhhhtMzZo13dPT0tJMQECAGThwoMcy+/TpY0qVKpXtegHApcYt6wCQj+69917t3r1bd911l7755hvNnz8/yzxr1qzRwYMH9eCDD3p8r7xz586Ki4vTV1995TH/qVOnJEkhISG5zmPv3r2aNWuWxowZk+XWzOjoaEnSnj17clzG/Pnzdf3116ts2bJyuVzuV9u2bZWRkaHvv/9ekvTxxx/L4XBo7NixWZaR3a3xuXH06FG5XC45nU5NmTJFmZmZatOmjSQpIyND33zzjbp166batWu7YypXrqy77rpLP/74o44dO5arfh555BG99957mjdvntcr06dOnfJp20vSM888o4iICA0dOtRj+oYNG5ScnKy77rpLf/31l3ubnjhxQjfeeKO+//77LF8HOHz4sMf2P3r0qE+5nPPtt9/q1KlTGj58uMdV5Pvvv1/h4eFZjrvTp0/L5XLp0KFD+vnnn/Xpp5+qYcOG7rsarPI1H1/5+nMmSSdPnszVWA+hoaHu///99986evSorr/++myvulasWFGdO3dWYmKipLN3nsybN099+/b1aX26deumqlWrut83a9ZM11xzjf73v/9Jkv78809t2LBB9957r8qVK+eer2HDhmrXrp17vnPCwsL0xRdf6PDhw+rZs6f7CRAZGRm6/fbb9ffff+vzzz/3WNfz5WZbffLJJ8rMzFTPnj09juFKlSopNjZWy5Yt85g/IyPDYz6Xy6XU1NQc+0hNTdX48eM1ZMgQ1ahRw6PtxIkTyszMVPny5XNcBgDYiVvWASAfHT58WB988IFuueUWbdmyRcOGDVP79u09vkN+7lbVyy67LEt8XFycfvzxR49p575P68t3HseOHasqVapo4MCBWb7b2rx5czkcDo0aNUoTJkxwL/fCQjA5OVm//vqr+3bnCx08eFDS2Vv0q1Sp4lEEWNWtWzf3/wMCAjR69Gj16NFDknTo0CGlpqZmu/3i4+OVmZmp3bt3q0GDBjn
2024-10-26 13:42:05 +04:00
"text/plain": [
2024-10-26 14:00:22 +04:00
"<Figure size 1200x600 with 1 Axes>"
2024-10-26 13:42:05 +04:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-10-26 14:00:22 +04:00
"import matplotlib.pyplot as plt\n",
"\n",
"year_counts = data[\"Year_Birth\"].value_counts().sort_index()\n",
"\n",
"plt.figure(figsize=(12, 6))\n",
"year_counts.plot(kind=\"bar\", color=\"skyblue\", edgecolor=\"black\")\n",
"plt.title(\"Количество клиентов по годам рождения\")\n",
"plt.xlabel(\"Год рождения\")\n",
"plt.ylabel(\"Количество клиентов\")\n",
"plt.show()\n"
2024-10-26 13:42:05 +04:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная гистограмма отображает распределение доходов среди клиентов. На оси X указаны значения доходов, разбитые на 50 интервалов, что позволяет увидеть, как доходы распределены по разным уровням. На оси Y указано количество записей (частота) в каждом интервале дохода. Анализируя гистограмму \"Income\", можно сделать вывод о том, как варьируются доходы. Например, мы можем увидеть, что большинство клиентов имеют доход в пределах определенного диапазона, и только небольшая часть имеет более высокий доход."
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1IAAAIQCAYAAACLwV/UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABHAUlEQVR4nO3dfVxUZf7/8TeI3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jnVP2LEiHN+Vnl4eGjPnj2O5efMmaP27dvLx8dHDRs2VHx8vHJycpy2cfbnTkhIiOLi4rRz585z7lsAlYczUgAuqOLQU69ePUnSzz//rCVLlujPf/6zIiIilJmZqddff11XX321du3apYYNG0qSCgsLdcMNN2j16tW67bbbNG7cOB05ckQrV67Uzp071aJFC8c2br/9dvXv399puxMnTiy1nmeeeUYeHh565JFHlJWVpVdeeUUxMTHaunWr/Pz8JJ3+ItyvXz9FRUU5vpjPmzdP1157rb788kt17969xHobN26sadOmSTr95WzMmDGlbvuJJ57Q4MGD9de//lUHDx7Uq6++qquuukpbtmxRcHBwiWVGjx6tK6+8UpL0wQcfaPHixU7z7777biUmJmrkyJG67777lJaWptdee01btmzRunXrVLNmzVL3g42cnBzHcztTUVGRbrrpJn311VcaPXq02rZtqx07dujll1/WDz/8UO5QIEl9+/bVsGHDJEkbN27UrFmznOafOHFCvXv31o8//qixY8cqIiJCSUlJGjFihHJycjRu3DhJ0uOPP66PPvpIo0aN0o4dO1S7dm0tX75c//znPzV16lR17tzZan1nK750VZJeeumlEqFk1apV6tevny677DJNnjxZJ06c0KuvvqqePXvq22+/LRG8/v3vf0uSsrOzNWfOHP35z3/Wzp071bp16zL31f79+9W9e3fl5ORo9OjRatOmjfbt26f33ntPx48fl7e3t6Pv2LFjFRwcrMmTJys1NVUJCQn65ZdfHH9YKK5h+PDhio2N1fPPP6/jx48rISFBvXr10pYtW0oNi126dNEDDzwg6fQfSZ588sky6y32448/6p///Od5+5WmoKBAgwYNUnp6utatW6cGDRqU2q94f0rS/ffff971vvTSS6Xew1mRz4BzufvuuxUTE+OYvuOOO3TLLbdo4MCBjrb69etLOh3OnnrqKcXExGjMmDGO47Zx48YS7+k2bdrosccekzFGP/30k2bMmKH+/fsrPT3dqj4AFWQAoBLMmzfPSDKrVq0yBw8eNHv37jULFy409erVM35+fuZ///ufMcaYkydPmsLCQqdl09LSjI+Pj5kyZYqj7c033zSSzIwZM0psq6ioyLGcJPPCCy+U6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w53us6tZs6buu+8+HT16VGvXrnW0d+jQQU899ZT+9a9/KTY2VtnZ2Zo/f768vLwqtL7y1nngwAFt3bpVI0aMUN26dR3tnTp1Ut++fR2vsTMV77OUlBTNnTtXtWrV0uWXX17mNoqKirRkyRLdeOONjnsRz3T2e2P06NFOZzDGjBkjLy8vRy0rV65UTk6Obr/9dqdjWKNGDfXo0aPUY1ie1/vZNm/erKSkJE2bNs3x/i+vhx56SG+//bYWLVpU5pmg/Pz8c75XSjN16lQFBQXpvvvuc2qvyGfAoUOHnPbf4cOHrWoptmrVKuXn52v8+PFO++muu+5SYGCgPvnkE6f+xe/pgwcPKjk5WYsXL1anTp0UEhJSoe0DsMOlfQAq1ezZs9WqVSt5eXkpLCxMrVu3dvpCUFRUpJkzZ2rOnDlKS0tTYWGhY17x5X/S6UsCW7du7fTltzJERkY6TXt4eKhly5aO+xN2794tSRo+fHiZ6zh8+LDq1Kn
"text/plain": [
"<Figure size 1000x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"plt.figure(figsize=(10, 6))\n",
"data[\"Income\"].plot.hist(bins=50, color='skyblue', edgecolor='black')\n",
"plt.title(\"Распределение доходов среди клиентов\")\n",
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная круговая диаграмма отображает распределение клиентов по их семейному положению. На ней представлены различные категории семейного положения, такие как Married, Together, Single, Divorced и Widow, каждая из которых окрашена в отдельный цвет и подписана соответствующим процентом от общего числа клиентов. Анализируя эту диаграмму, можно сделать вывод о том, что наибольшую долю клиентов составляют Married (38.7%) и Together (26.0%), что указывает на преобладание семейных или живущих вместе клиентов. "
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAApsAAAKSCAYAAACdnRCsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMi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di549e+Lpp5+GRqPBzp07sW/fPrRs2RJA+d77Dg4OWLduHRITE+Hn5wcAyMnJweLFi+Hg4FDs/u/3Z0Cj0eC1116753N4Nzk5OejUqRMuXLiASZMmoVatWli6dClGjhyJ1NRUTJkyxeD6Dg4OmDNnjkGZLumDqlOnTggODsb8+fMxcOBAg8vmz5+POnXqoHXr1vfMZ6zXPywsTP/cJSUlFdu9WvR6PPDAA/jwww+RkJCAr776Crt37zZ4vWfPno3OnTujd+/e2L9/Pzw9PYvd14EDBzBixAj873//w7hx4wxyt23bFtWqVcP06dPh7OyMJUuWYMCAAVi+fHmx5+1+ffbZZ2Uad/DBBx/gtddeQ4cOHTBx4kT9+3D//v3Yv38/7O3tS71t0S7gFi1aGCxPTk7GpUuX8Oqrr+KRRx7BCy+8gEOHDuHTTz/FqVOnsG7dOn05/uOPPzBixAh0794dH3/8MbKzs/HDDz+gXbt2OHr0qL4YZ2VlYeDAgQgJCUFOTg7mzp2LQYMGYe/evSV+thWxsbHBTz/9hDZt2uDdd9+Fn58fjhw5gn/++UdfAP/8808AwPDhw0tch7u7O/r374/ffvsNFy5cQN26de/5vGZnZ2Pz5s1o3769wXv
"text/plain": [
"<Figure size 800x800 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"filtered_data = data[data[\"Marital_Status\"].isin([\"Married\", \"Together\", \"Single\", \"Divorced\", \"Widow\"])]\n",
"\n",
"plt.figure(figsize=(8, 8)) \n",
"filtered_data[\"Marital_Status\"].value_counts().plot(\n",
" kind=\"pie\", \n",
" autopct='%1.1f%%', \n",
" colors=['salmon', 'skyblue', 'lightgreen', 'orange', 'purple'], \n",
")\n",
"plt.title(\"Распределение клиентов по семейному положению (без YOLO и Absurd)\")\n",
"plt.ylabel(\"\") \n",
"plt.show()\n"
2024-10-26 13:38:50 +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.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}