AIM-PIbd-31-Yakovlev-M-G/lab_1/lab_1.ipynb

185 lines
158 KiB
Plaintext
Raw Normal View History

2024-09-20 20:28:10 +04:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" price bedrooms bathrooms sqft_living sqft_lot floors \\\n",
"id \n",
"7129300520 221900.0 3 1.00 1180 5650 1.0 \n",
"6414100192 538000.0 3 2.25 2570 7242 2.0 \n",
"5631500400 180000.0 2 1.00 770 10000 1.0 \n",
"2487200875 604000.0 4 3.00 1960 5000 1.0 \n",
"1954400510 510000.0 3 2.00 1680 8080 1.0 \n",
"\n",
" view condition grade sqft_above sqft_basement yr_built \n",
"id \n",
"7129300520 0 3 7 1180 0 1955 \n",
"6414100192 0 3 7 2170 400 1951 \n",
"5631500400 0 3 6 770 0 1933 \n",
"2487200875 0 5 7 1050 910 1965 \n",
"1954400510 0 3 8 1680 0 1987 \n"
]
}
],
"source": [
"import pandas as pd\n",
"\n",
"df = pd.read_csv(\"../data/kc_house_data.csv\", index_col=\"id\")\n",
"\n",
"cleared_dff = df.drop([ \"yr_renovated\", \"waterfront\", \"sqft_living15\", \"sqft_lot15\", \"long\", \"lat\"], axis=1)\n",
"\n",
"print(cleared_dff.head())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### График 1\n",
"Отношение площади жилого пространства недвижимости на повышение цены"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAHACAYAAABeV0mSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABp2klEQVR4nO3deXQUZdo28KvSIQ0BkhAwCZAFZJUlEEQguABHZhhEFB0ZXOYVZ8Y5nw74qjgujDou82JUdkfGZ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Stoghur1YqnnnoKN998MwYNGqS4Xb9+/fCvf/0LX3/9NT799FNYrVaMHj0aJSUlstvn5OQgPj7e9pOWluavXSAiIqIgIIiiKOo9CAB4/PHHsX79enz//fdITU3V/LimpibccMMNeOCBB/C3v/2t1f0mkwkmk8n279raWqSlpaGmpgZxcXE+GTsRERH5V21tLeLj4zWdv3WdcyOZOXMm1qxZgx07drgV2ABAmzZtkJWVhRMnTsjebzQaYTQafTFMIiIiCgG6XpYSRREzZ85Ebm4utm7dip49e7r9HBaLBT///DO6du3qhxESERFRqNE1czNjxgwsW7YMX3/9NTp27Ijy8nIAQHx8PNq1awcAePjhh9G9e3fk5OQAAF5//XWMGjUKvXv3RnV1NebOnYuzZ8/i0Ucf1W0/iIiIKHjoGty89957AICxY8c63P7xxx/jkUceAQAUFRUhKqolwVRVVYU//vGPKC8vR6dOnXD
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"data = df[[\"price\", \"sqft_living\"]].copy()\n",
"data = data[0:1000]\n",
"plt.scatter(data[\"sqft_living\"], data[\"price\"], marker=\"^\")\n",
"plt.xlabel(\"Жилплощадь\")\n",
"plt.ylabel(\"Цена\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"На графике выше приведена информация о первой тысяче домов. График отображает зависимость цен недвижимости от жилой площади, исходя из графика можно сделать вывод, что чем больше площадь тем выше цена."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### График 2\n",
"Влияние количества этажей на продажу недвижимости"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAGwCAYAAAC0HlECAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9h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YAGhCQAAwAJCEwAAgAWEJgAAAAsITQAAABYQmgAAACwgNAEAAFhAaAIAALCA0AQAAGABoQkAAMACQhMAAIAFhCYAAAALCE0AAAAWEJoAAAAsIDQBAABYQGgCAACwgNAEAABgAaEJAADAAkITAACABYQmAAAACwhNAAAAFhCaAAAALCA0AQAAWEBoAgAAsIDQBAAAYAGhCQAAwAJCEwAAgAWEJgAAAAsITQAAABYQmgAAACwgNAEAAFhAaAIAALCA0AQAAGABoQkAAMACQhMAAIAFhCYAAAALaru6AAC/Q4tsrq7AeQ8Zrq4AgItxpQkAAMACQhMAAIAFhCYAAAAL3Do0lZaW6sUXX1R4eLh8fHz0hz/8Qa+88ooM4/+vLTAMQxMnTlRISIh8fHwUExOjb775xmE7BQUFGjhwoHx9feXv76+4uDidOHHCYcyuXbt02223ydvbW2FhYUpKSqqWYwQAADWDW4em119/XXPnztXs2bO1d+9evf7660pKStKbb75pjklKStKsWbOUnJysrVu3ql69eoqNjdXp06fNMQMHDlROTo5SU1O1evVqpaen64knnjD77Xa7evTooaZNmyorK0t//etf9dJLL2nevHnVerwAAMB92YwLL9u4md69eysoKEh///vfzbZ+/frJx8dH77//vgzDUGhoqMaMGaNnn31WklRUVKSgoCClpKRowIAB2rt3ryIjI7V9+3a1a9dOkrRu3Tr17NlTP/30k0JDQzV37lw9//zzysvLk6enpyRp/PjxWrFihfbt22epVrvdLj8/PxUVFcnX17eSZ0J82whXFs5nAG7Cmb/fbn2lqVOnTtq4caP+/e9/S5K++uorff7557rrrrskSQcOHFBeXp5iYmLMz/j5+alDhw7KzMyUJGVmZsrf398MTJIUExMjDw8Pbd261RwTHR1tBiZJio2N1f79+3Xs2LGL1nbmzBnZ7XaHFwAAuHK59XOaxo8fL7vdrubNm6tWrVoqLS3VlClTNHDgQElSXl6eJCkoKMjhc0FBQWZfXl6eAgMDHfpr166tgIAAhzHh4eHltnG+r2HDhuVqS0xM1OTJkyvhKAEAQE3g1leaPvzwQ33wwQdatGiRduzYoYULF+qNN97QwoULXV2aJkyYoKKiIvN18OBBV5cEAACqkFtfaRo7dqzGjx+vAQMGSJJatWqlH3/8UYmJiRo8eLCCg4MlSfn5+QoJCTE/l5+frzZt2kiSgoODdeTIEYftnjt3TgUFBebng4ODlZ+f7zDm/PvzY37Ny8tLXl5ev/0gAQBAjeDWV5pOnjwpDw/HEmvVqqWysjJJUnh4uIKDg7Vx40az3263a+vWrYqKipIkRUVFqbCwUFlZWeaYTZs2qaysTB06dDDHpKenq6SkxByTmpqqZs2aXfTWHAAA+P1x69DUp08fTZkyRWvWrNEPP/yg5cuXa9q0abr33nslSTabTQkJCfrLX/6ilStXavfu3XrkkUcUGhqqvn37SpJatGihO++8U0OHDtW2bduUkZGh4cOHa8CAAQoNDZUkPfTQQ/L09FRcXJxycnK0ZMkSzZw5U6NHj3bVoQMAADfj1rfn3nzzTb344ot6+umndeTIEYWGhurJJ5/UxIkTzTHjxo1TcXGxnnjiCRUWFurWW2/VunXr5O3tbY754IMPNHz4cHXv3l0eHh7q16+fZs2aZfb7+fnp008/VXx8vNq2bavGjRt
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = df[\"floors\"]\n",
"plt.hist(data, color=\"orange\")\n",
"plt.xlabel('Кол-во этажей')\n",
"plt.ylabel('Частота покупки')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная диаграмма отображает частоту продаж домой, в зависимости от этажей, исходя из диаграммы можно сделать вывод, что одноэтажные дома покупают чаще чем другие, на втором месте по продажам двухэтажные"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### График 3\n",
"Зависимость даты от почтового индекса"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHyCAYAAAD2jvplAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwg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CaTTzsPP/wwP//5zwPaH06n6YYXtw14wiu/iAQCwZeb/m64/aHTSPT0yoN2HodafihOo2D0o9PA6iXzmZaREG1RBuQ0RX0j+PLly5FlmYyMDAwGA3/4wx+4/vrr0Wj6RFu2bBnbtm1j9erV7Nq1i6eeeoolS5bwn//8J6Aup9PJFVdcwbRp03j44YdHVO6lS5fS0tKi/quqqhrW+svtrkH9QhIOk0AgAIbkMAF0D8HhGY7ywmE6venuhaue3RJtMQZM1DeCT5w4kY0bN+J2u3E6naSlpXHdddeRl5dHe3s7P/7xj1m5cqW652nGjBkUFxfz5JNPcumll6r1tLa2cvnll2M2m1m5ciV6vV5NGz9+PDt27PBp9/jx42qa8l/lmncei8US8JQJwGAwYDAYhkcJQeh7Py4QCAQCwelJd6/MOzurRtWruv6I+pMmhbi4ONLS0mhqamLt2rV87Wtfo6uri66uLvWpk4JWq6W39+TvEKfTycKFC4mJiWH16tUYjUaf/HPnzmXfvn3U19er19atW4fFYmHatGlqng8//NCn3Lp165g7d+5wdzVCpCi1KxAIBALBqWHLYUe0RRgQUX/StHbtWmRZZsqUKZSVlfHAAw9wxhlncMstt6DX67ngggt44IEHMJlM5OTksHHjRl577TV++9vfAicdpra2NlasWIHT6cTp7NvYZrPZ0Gq
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from datetime import datetime\n",
"import matplotlib.dates as md\n",
"data = (df[[\"zipcode\", \"date\"]].copy())\n",
"data[\"date\"] = data.apply(lambda row: datetime.strptime(row[\"date\"], \"%Y%m%dT000000\"), axis=1)\n",
"plot = data.plot.scatter(x=\"date\", y=\"zipcode\")\n",
"plot.xaxis.set_major_locator(md.DayLocator(interval=10))\n",
"plot.xaxis.set_major_formatter(md.DateFormatter(\"%d.%m.%Y\"))\n",
"plot.tick_params(axis=\"x\", labelrotation=90)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Данная диаграмма отображает под каким почтовым индексом и когда был куплен дом, исходя из графика можно сделать вывод, в каких районах города больше всего скупаются дома"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "kernel",
"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
}