2024-10-26 13:38:50 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Начало лабораторной \n",
"\n",
"Выгрузка данных из csv файла в датафрейм"
]
},
{
"cell_type": "code",
2024-10-26 13:42:05 +04:00
"execution_count": 1,
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 13:42:05 +04:00
"execution_count": 4,
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 13:42:05 +04:00
"Данная гистограмма отображает распределение значений года рождения среди клиентов. Н а оси X указаны годы рождения, разбитые на 100 интервалов, чтобы отобразить каждый год с большей детализацией. Н а оси Y показано количество записей (частота) для каждого года. Анализируя гистограмму по столбцу \"Year_Birth\", можно сделать выводы о возрастной структуре клиентов. Например, можно увидеть, что большинство клиентов родились между 1950 и 1980 годами, а количество рождений до 1940 года и после 1980 года значительно ниже."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Axes: ylabel='Frequency'>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAj8AAAGdCAYAAAD9kBJPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAqxUlEQVR4nO3deXRUZZ7/8U9lJYEsEMnWBBIFAQkqi00H0EbIABo5bGdUxGaREVqDLFFpOAOooEZcMKLI1hKgWxvlCDbqGAdDQG0jsgQUdcJO0CyoSALBLCT39we/1EyRoKSoSiV53q9z6hzr3qee+62Hgvr41HPvtVmWZQkAAMAQXp4uAAAAoCERfgAAgFEIPwAAwCiEHwAAYBTCDwAAMArhBwAAGIXwAwAAjEL4AQAARvHxdAHuVl1drfz8fAUFBclms3m6HAAAcBksy9KZM2cUHR0tLy/XztU0+/CTn5+vmJgYT5cBAACccOLECbVr186lfTb78BMUFCT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fwAAACjEH4AAIBRCD8AAMAohB8AAGAUj57tBQAwS13X8PEkrilkJmZ+AACAUQg/AADAKIQfAABgFMIPAAAwCuEHAAAYhfADAACMQvgBAABGIfwAAACjEH4AAIBRCD8AAMAohB8AAGAU7u0FAKjl4nteefp+V42tHjRtzPwAAACjEH4AAIBRCD8AAMAohB8AAGAUwg8AADAK4QcAABiF8AMAAIxC+AEAAEYh/AAAAKMQfgAAgFG
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data.plot.hist(column=[\"Year_Birth\"], bins=100)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная гистограмма отображает распределение доходов среди клиентов. Н а оси X указаны значения доходов, разбитые на 50 интервалов, что позволяет увидеть, как доходы распределены по разным уровням. Н а оси Y указано количество записей (частота) в каждом интервале дохода. Анализируя гистограмму \"Income\", можно сделать вывод о том, как варьируются доходы. Например, мы можем увидеть, что большинство клиентов имеют доход в пределах определенного диапазона, и только небольшая часть имеет более высокий доход."
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1IAAAIQCAYAAACLwV/UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABHAUlEQVR4nO3dfVxUZf7/8TeI3ImAioD3kuL93YqrkVaWGCmVpbtWq3mTm+ViaXbrdqNpZVlZWortbomttSaVtpV5m1kZmpq3SWSF4aqAZIi3gHD9/vDHfB0B5SJ0Bnw9H495PDzXuc45nzlnZpw355xrPIwxRgAAAACAcvN0dQEAAAAAUNUQpAAAAADAEkEKAAAAACwRpAAAAADAEkEKAAAAACwRpAAAAADAEkEKAAAAACwRpAAAAADAEkEKAAAAACwRpAAAAADAEkEKQKVITEyUh4eH4+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UU5vpjPmzdP1157rb788kt17969xHobN26sadOmSTr95WzMmDGlbvuJJ57Q4MGD9de//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+U6NO+fXtz9dVXO6bXrFljJJlGjRqZ3NxcR/uiRYuMJDNz5kzHuiMjI01sbKxjO8YYc/z4cRMREWH69u1bYltXXHGF6dChg2P64MGDRpKZNGmSo23Pnj2mRo0a5plnnnFadseOHcbLy6tE++7du40kM3/+fEfbpEmTzJkf219++aWRZN5++22nZZctW1aivVmzZiYuLq5E7fHx8ebs/wrOrv3hhx82oaGhJioqymmf/vvf/zaenp7myy+/dFp+7ty5RpJZt25die2dLT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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": "iVBORw0KGgoAAAANSUhEUgAAApsAAAKSCAYAAACdnRCsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACicElEQVR4nOzdd1hTVwMG8Pcm7L2XojjBLWJt3eKoe1VrtcPZqlWrfh3WbruX3dMOta17a7Wte+89UXELMgRkzyTn+4OSGgEFIZyM99eHx3KT3LwZkJd77zlXEUIIEBEREREZgUp2ACIiIiKyXCybRERERGQ0LJtEREREZDQsm0RERERkNCybRERERGQ0LJtE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OnTujd+/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
}