214 lines
117 KiB
Plaintext
214 lines
117 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## **НАЧАЛО ЛАБЫ**\n",
|
|||
|
"\n",
|
|||
|
"Выгрузка данных из csv"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Index(['id', 'name', 'est_diameter_min', 'est_diameter_max',\n",
|
|||
|
" 'relative_velocity', 'miss_distance', 'orbiting_body', 'sentry_object',\n",
|
|||
|
" 'absolute_magnitude', 'hazardous'],\n",
|
|||
|
" dtype='object')\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import pandas as pd\n",
|
|||
|
"df = pd.read_csv(\".//static//csv//neo.csv\", nrows=15000)\n",
|
|||
|
"print(df.columns)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## **СТОЛБЦЫ ДАТАСЕТА:**\n",
|
|||
|
"\n",
|
|||
|
"**Id**\n",
|
|||
|
"\n",
|
|||
|
"**name**\n",
|
|||
|
"\n",
|
|||
|
"**est_diameter_min** – минимальный радиус косм. объекта (астероид, комета) рядом с Землёй (км)\n",
|
|||
|
"\n",
|
|||
|
"**est_diameter_max** – максимальный радиус косм. объекта\n",
|
|||
|
"\n",
|
|||
|
"**relative_velocity** – скорость относительно Земли (км/с)\n",
|
|||
|
"\n",
|
|||
|
"**miss_distance** – расстояние, на кот. проходит рядом с Землёй (км)\n",
|
|||
|
"\n",
|
|||
|
"**orbiting_body** – тело, вокруг которого вращается (везде Земля)\n",
|
|||
|
"\n",
|
|||
|
"**sentry_object** – ведётся ли за ним авто мониторинг, как за телом, кот. может столкнуться с Землёй (везде false)\n",
|
|||
|
"\n",
|
|||
|
"**absolute_magnitude** – звёздная величина (яркость)\n",
|
|||
|
"\n",
|
|||
|
"**hazardous** – опасный для Земли / нет"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## Диаграмма ниже показывает разницу между максимальным вероятным диаметром космического объекта и минамальным (на срезе первых 100 объектов). С помощью неё можно увидеть, что у большинства объектов разница между этими двумя значениями составляет меньше 1 км, что говорит о достаточно хорошей точности измерения размера объекта"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 22,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Axes: title={'center': 'Разница между макс. диаметром (est_diameter_max) и мин диаметром (est_diameter_min) объекта (первые 100 записей)'}, xlabel='Порядковый номер объекта в датасете', ylabel='Разница'>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 22,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABDwAAAIjCAYAAADvOguXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACOvklEQVR4nOzde3zP9f//8ft7Y2cbsxlDM4dUcor4aHKKkEQnWcpIp++HkE50oKhUOpCESkRSqejTSUkOkUNO5ZTIHHLcsM02Nrbn749+e+dtp/dme7/fe+12vVx24f18vd6v1/P1ej/fz/fr9Xg9DzZjjBEAAAAAAICFeLk7AwA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dq1tvvVWXXXZZrsCH9E/0v3///oqPj9fatWtVuXLlPPM3duxYRUdHS/rnnJ1fUdx2220aPHiw5s6dq+bNmzu8b+7cuerQoYNq1qxZ6Dk4deqUvv76a9188832tJkzZ8rPzy9X5Thr1iwFBQVpxIgRCgoK0k8//aTRo0crJSVFEyZMyHcfM2fO1NNPP63XXntNd955pz198eLFuvHGG1WjRg0NGzZM1atX144dO/T1119f9MBWBZ27/IwePTrPPmhFOW4/Pz998803OnbsmH0k8tOnT+uTTz6Rn59frm0/8MADmjVrlgYOHKihQ4cqPj5eb731ljZt2qRVq1apYsWKmjhxor0/4o4dO/Tiiy/qySef1OWXXy5JuW6cZs+erVO
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 1200x600 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"data1 = df[:100].copy()\n",
|
|||
|
"data1['diameter_dif'] = data1['est_diameter_max'] - data1['est_diameter_min']\n",
|
|||
|
"data1['index'] = data1.index\n",
|
|||
|
"data1.plot(kind='scatter', x='index', xlabel='Порядковый номер объекта в датасете', y='diameter_dif', ylabel='Разница', figsize=(12, 6), title='Разница между макс. диаметром (est_diameter_max) и мин диаметром (est_diameter_min) объекта (первые 100 записей)')"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## На диаграмме ниже показана средняя скорость относительно Земли для космических объектов, которые потенциально опасны (hazardous=true) и неопасны (hazardous=false). С помощью неё можно сделать вывод о том, что потенциально опасны те космические объекты, у которых относительная скорость в среднем больше 60 000 км/с"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 69,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<matplotlib.legend.Legend at 0x2530c87c410>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 69,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1AAAAIiCAYAAADGhilPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABRyUlEQVR4nO3deXhN997//9dOyCTZCUEixNQYElJDVKS0uJsj2nBoHVPVVNXTHhSJ8S6qdVoOHeih1epdcXrqGDqolsbtjtKW1BCNmquqjZZEakhQmdfvD7+sry0JK6ZN83xc17oue633+qz3WsH2siabYRiGAAAAAABX5eLsBgAAAADgTkGAAgAAAACLCFAAAAAAYBEBCgAAAAAsIkABAAAAgEUEKAAAAACwiAAFAAAAABYRoAAAAADAokrObsCZioqKdOzYMfn4+Mhmszm7HQAAAABOYhiGzp49q6CgILm4lH2eqUIHqGPHjik4ONjZbQAAAAC4TRw9elR16tQpc3mFDlA+Pj6SLh4ku93u5G4AAAAAOEt2draCg4PNjFCWCh2gii/bs9vtBCgAAAAAV721h4dIAAAAAIBFBCgAAAAAsIgABQAAAAAWVeh7oKwoKipSXl6es9sAcJ3c3Nyu+EhSAAAAKwhQV5CXl6cjR46oqKjI2a0AuE4uLi5q0KCB3NzcnN0KAAC4gxGgymAYho4fPy5XV1cFBwfzP9fAHaz4pdnHjx9X3bp1eXE2AAC4ZgSoMhQUFOj3339XUFCQvLy8nN0OgOtUo0YNHTt2TAUFBapcubKz2wEAAHcoTquUobCwUJK43Af4gyj+s1z8ZxsAAOBaEKCugkt9gD8G/iwDAIAbgQAFAAAAABZxD1Q5paVJv/1267ZXvbpUt+6t2x5wJ+nVq5fGjBmje++9V4899pgGDBigbt26ObstAADwB0aAKoe0NK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Dh7R69Wpt3rxZ9957ryTp/fffV3BwsFatWqXevXtf07jXcsyTkpK0e/duHTlyRMHBwZKkf/3rX2rWrJm2b9+ue+65R5JUqVIlh5/v5Wcsa9eubQZnSRo1apTWrVunFStWqG3btjp79qzmzZun+fPna/DgwZKku+66Sx06dLimfS2v2bNnKywsTAUFBbdkewAAoOLiDFQFtX//frVv395hXvv27XXo0CFLLxrdvXu3CgsL1bhxY3l7e5vTpk2bHC6by8rKcljerFmz6+r7999/15QpUzR79mxVquSY/w8dOqT+/furYcOGstvtql+/vqSLweNS2dnZqlKlyhW3c++998rHx0fBwcHq27evfvnlF4fl/fv3d9ivr776yly2f/9+VapUSZGRkeY8f39/NWnSRPv377/idq80rtVjfqn9+/crODjYDE+SFBYWJj8/v6v2cqnCwkLNmDFD4eHhqlatmry9vbVu3Trz2O7fv1+5ubl64IEHrjjOvffe69D75T+bS49BrVq1FBsbq3379l1xzGPHjunVV191uAQVAADgZuEMFK7JuXPn5OrqqpSUlBJncC69jMrHx0c7d+40P//666/q1KnTNW93zpw5atKkibp3717iMrPu3burXr16WrRokYKCglRUVKTmzZsrLy/Poe7YsWPmGZyyLF++XKGhoUpPT9czzzyjp556Sp999pm5/LXXXnN44tuAAQOueZ8udaVxrR7zm2HOnDmaN2+e5s6dq/DwcFWpUkVjxowxj62np6elcYqPa7HSfi8UH4MzZ87ov//7v9WnTx/t2bOnzDGfffZZ9e7dWy1atCjfTgEAAFwDAlQFFRoaqs2bNzvM27x5sxo3bmzpkrZWrVqpsLBQJ06c0H333VdmnYuLi0JCQszPl581Ko/jx4/rzTff1KZNm0osO3nypA4ePKhFixaZ/Xz99dcl6g4fPqzTp0+rVatWV9xWcHCwQkJCFBISomHDhmnmzJkOywMDAx3269IAERoaqoKCAm3dutW8hK+4v7CwsCtu90rjWj3mlwoNDdXRo0d19OhR8yzUvn37dObMmav2cqnNmzerR48eeuyxxyRdvLfq+++/N8do1KiRPD09lZSUpCeeeKLMcYqPa7HSfj9cegxGjx6t7t27l3nvWGpqqj744AMdPHjQ8r4AAABcDwJUBRUfH6977rlHM2bMUN++fZWcnKz58+frjTfesLR+48aNNWDAAA0aNEivvPKKWrVqpczMTCUlJenuu+9WbGxsufrJzc1VzmXPiM/Pz1dRUZFcXC5eabpgwQL16tWr1PBTtWpV+fv76+2331atWrWUlpamSZMmOdTs2LFDzzzzjMLDw9WmTZsr9pOXl6ecnBxlZGTogw8+cLiH6moaNWqkHj16aPjw4Xrrrbfk4+OjSZMmqXbt2urRo4flcS53Lcc8Ojpa4eHhGjBggObOnauCggL97W9/U8eOHa96DC7fpw8++EBbtmxR1apV9eqrryojI8MMUB4eHpo4caImTJggNzc3tW/fXpmZmdq7d6+GDRtWrv3Mz89XTk6Ozpw5o3//+99q3LixKleuXGrtyy+/rPj4+KueUQRwB7DZnN0B4HyG4ewOYAH3QJVD9eoXX2x7K3l4XNzujda6dWutWLFCy5YtU/PmzTVt2jS98MILGjJkiOUxFi9erEGDBik+Pl5NmjRRz549tX37dtW1+tbfSwQGBsrT09OcJKlPnz768ssvzZqioiLzsdiXc3Fx0bJly5SSkqLmzZtr7NixmjNnjkPN2LFjVadOHa1du1a2q3xRR0ZGytPTUy1btpS3t7feeuutcu3P4sWLFRERoW7duikqKkqGYWjt2rVlBoHyjFueY26z2fTJJ5+oatWquv/++xUdHa2GDRtq+fLl5drulClT1Lp1a8XExKhTp04KDAx0eIS8JE2dOlXx8fGaNm2aQkND1bdvX504caLc+9inTx95enqqcePGOn78+BV79fHx0YQJE8q9DQA
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 1000x600 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Группировка данных по значению 'hazardous' и вычисление средней относительной скорости\n",
|
|||
|
"data2 = df.groupby('hazardous')['relative_velocity'].mean()\n",
|
|||
|
"handles = [plt.Rectangle((0,0),1,1, color='blue'), plt.Rectangle((0,0),1,1, color='red')]\n",
|
|||
|
"labels = ['Потенциально не опасный', 'Потенциально опасный']\n",
|
|||
|
"data2.plot(kind='bar', figsize=(10, 6), color=['blue', 'red'], xlabel='Значение столбца \"hazardous\"')\n",
|
|||
|
"plt.legend(handles, labels)\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"#ПОЧЕМУ НЕ ОТОБРАЖАЕТСЯ ОБЕ ПОЛОСКИ В КОДЕ НИЖЕ без handles?\n",
|
|||
|
"# plot = df.groupby('hazardous')['relative_velocity'].mean().plot.bar(color=[\"pink\", \"green\"])\n",
|
|||
|
"# plot.legend([\"Потенциально не опасный\", \"Потенциально опасный\"])"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"## Диаграмма ниже показывает процентное соотношение космических объектов, за которыми ведётся автоматическое наблюдение, т.к. они представляют серьёзную угрозу, и космических объектов, за которыми такое наблюдение не ведётся. На диаграмме видно, что за всеми космическими объектами наблюдения не ведётся. Это означает, что в данном датасете нет настолько опасных космических объектов, которые требовали бы постоянных наблюдений"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 70,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<matplotlib.legend.Legend at 0x2530c8b6b70>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 70,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAo8AAAJ8CAYAAACflkvMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGo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HjjUxMTFmx44dXmc4d+6cGTdunKldu3aO9zlw4ICRZH744Ydsbz9x4oQJDg72eA+ePXvW1KhRw7z44ovGmJxfq8zrRHZeeuklc8kll7i/bteunenfv3+O9z9/nTPGeV9mfr/mtM4ZY8wDDzzg8X6Kj483w4YNM1WqVDG//fabMcb5/Tpu3DgjyaxYsSLb5XizrsbHx5vGjRub9PR0933mzJljypQpY06ePOm+Lqf3V4adO3eaoKAgs2fPHo/rO3fubB577DFjzF/r8+HDh02LFi1M//79PR43swt570VGRpoRI0aYp59+2hjjbHdatGhhevfunevvxszb5IJi5BHIRceOHZWYmOhxefvttz3u8/3332vWrFnu3VLh4eHq2rWr0tPTtWPHjgt6/NKlS6tt27bur5s0aaKoqCht2bJFkrRlyxa1b9/e43vat2/vvj2zvXv36uWXX9akSZM8rk9MTFRQUJDi4+NzzFG/fn1NnDhRL7zwgnr16qXbb7/dfduWLVtUq1Yt1apVy33dRRdd5JFTknu3d/ny5fN83qdOndITTzyhF198UaVLX9ih2Wl
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 800x800 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"data3=df['sentry_object'].value_counts()\n",
|
|||
|
"labels=['Не происходит автомониторинг, как за опасным объектом', 'Происходит автомониторинг, как за опасным объектом']\n",
|
|||
|
"colors=['blue', 'red']\n",
|
|||
|
"data3.plot(kind='pie', figsize=(8, 8), labels=None, colors=colors, autopct='%1.1f%%')\n",
|
|||
|
"handles = [plt.Line2D([0], [0], color=colors[0], lw=4), plt.Line2D([0], [0], color=colors[1], lw=4)]\n",
|
|||
|
"plt.legend(handles, labels)"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"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.5"
|
|||
|
}
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 2
|
|||
|
}
|