AIM-PIbd-31-Kozyrev-S-S/laba1.ipynb

204 lines
176 KiB
Plaintext
Raw Permalink Normal View History

2024-09-13 17:40:03 +04:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Выгружаем данные при помощи Pandas из csv файла в количестве 10000 строк."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"df = pd.read_csv(\"data/age.csv\", nrows=10000)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Смотрим количество и название столбцов таблицы"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Index: 12359 entries, 0 to 9999\n",
"Data columns (total 10 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 Id 12359 non-null object \n",
" 1 Name 12359 non-null object \n",
" 2 Short description 12354 non-null object \n",
" 3 Gender 12273 non-null object \n",
" 4 Country 12080 non-null object \n",
" 5 Occupation 12188 non-null object \n",
" 6 Birth year 12359 non-null int64 \n",
" 7 Death year 12358 non-null float64\n",
" 8 Manner of death 2486 non-null object \n",
" 9 Age of death 12358 non-null float64\n",
"dtypes: float64(2), int64(1), object(7)\n",
"memory usage: 1.0+ MB\n",
" count mean std min 25% 50% \\\n",
"Birth year 12359.0 1773.275993 298.845499 -2284.0 1787.0 1870.0 \n",
"Death year 12358.0 1840.944813 303.842150 -2200.0 1853.0 1938.0 \n",
"Age of death 12358.0 67.686519 17.137864 4.0 57.0 70.0 \n",
"\n",
" 75% max \n",
"Birth year 1905.0 1996.0 \n",
"Death year 1979.0 2021.0 \n",
"Age of death 80.0 107.0 \n"
]
}
],
"source": [
"print(df.describe().transpose())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Узнаем количество людей относящихся к той или иной стране"
]
},
{
"cell_type": "code",
2024-09-13 17:47:57 +04:00
"execution_count": 12,
2024-09-13 17:40:03 +04:00
"metadata": {},
"outputs": [
{
"data": {
2024-09-13 17:47:57 +04:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAALqCAYAAADNfaViAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1gU1/s28HvpvQq2iGBXBLuxxdjB3nusqDFi92uLsWDsvUajJtbEEnuKPfbeS2woqCT2LhhB4Hn/4N35MewCswYDbu7Pde2lO3t25szsMPPMqToRERARERF94CwyOwNEREREGYFBDREREZkFBjVERERkFhjUEBERkVlgUENERERmgUENERERmQUGNURERGQWGNQQERGRWWBQQ0RERGaBQQ0R4datW9DpdFi2bNm/ts1ly5ZBp9Ph1KlT/9o2/2u2b9+OkiVLws7ODjqdDs+fP8/sLP0jOp0OY8aMyexsUBbGoIayNJ1Op+m1b9++fyU/L1++RFhYGEqUKAEnJyfY29ujePHiGDp0KO7evfuv5CE9v/32Gy/8H5AjR45gzJgxGR5wPHnyBK1atYK9vT3mz5+PlStXwtHRMUO3QZTVWGV2BojSsnLlStX7FStWYNeuXQbLixYt+t7zEhERgVq1auHOnTto2bIlevToARsbG1y4cAHfffcdNm3ahOvXr7/3fKTnt99+w/z5800KbPLmzYu///4b1tbW7y9jZNSRI0cQFhaGzp07w83NLcPWe/LkSbx69Qpff/01atWqlWHrJcrKGNRQlvbZZ5+p3h87dgy7du0yWP6+xcfHo1mzZnjw4AH27duHKlWqqD4fP348Jk+e/K/mKSPEx8cjMTERNjY2sLOzy+zsUAZ6+PAhAGRooESU1bH6iT54MTExGDRoEPLkyQNbW1sULlwY06ZNQ8oJ6HU6HXr37o0ffvgBhQsXhp2dHcqUKYMDBw6ku40NGzbg/PnzGDFihEFAAwAuLi4YP368atlPP/2EMmXKwN7eHtmy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avLrp37x7OnTuHzp07w8PDQ/k8MDAQtWvXVvLxLmrVqqUqIQkMDISLi4tJv1dy7/PcAoDQ0FDV+z59+gCAcgw2btyIxMREtGrVSjknHj9+jBw5cqBgwYLYu3fvO+ezd+/eyv/1JS9xcXHYvXu30byKCDZs2ICGDRtCRFT5CQoKwosXL3DmzJl/dDzow8Oghj5ot2/fRq5cuQwCDn1vqNu3b6uWFyxY0GAdhQoVwuvXr/Ho0aNUt+Pi4qK6oaaXJwBG23oUKVLEIE+m8PHxUb3XBzjJ26CkJ60gQO/GjRsQEYwcORJeXl6ql766R98QdezYsXj+/DkKFSqEgIAADB48GBcuXNCcn5S/iZOTE3LmzKlqV9KxY0f8/fff2LRpEwDg2rVrOH36dLrVgTdv3gSANKsW0/q9ihYtisePHyMmJkbTvqSU8vcCkn4zU36v5N7nuQUY/hb58+eHhYWF8luEh4dDRFCwYEGD8+LKlSvKOWFqPi0sLJAvXz7VskKFCgFAqu2LHj16hOfPn2PRokUGeenSpQuA/ztH6b+DbWqINChSpAjOnj2LqKgo5MmTJ8PWq9PpjDaGTK3UyNLS0uhyY+tIjb29fbpp9G1s/ve//yEoKMhomgIFCgAAqlatips3b2LLli3YuXMnlixZgpkzZ2LhwoXo1q2b5nylpVixYihTpgxWrVqFjh07YtWqVbCxsUGrVq0yZP1apWwMrPc+f6/MlHJ/ExMTodPpsG3bNqP75uTk9G9lTTlHP/vsM6VRdEqBgYH/Wn4oa2BQQx+0vHnzYvfu3Xj16pWqtObq1avK58kZqyK5fv06HBwc0qySadiwIVavXo1Vq1Zh+PDh6eYJSCpNqFG
2024-09-13 17:40:03 +04:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df['Country'] = df['Country'].str.split('; ')\n",
"df1 = df.explode('Country')\n",
"countrys = df1.groupby(\"Country\").size().reset_index(name=\"Count\") # type: ignore\n",
"country_counts_sorted = countrys.sort_values(by='Count', ascending=False)\n",
"top_countries = country_counts_sorted.head(50)\n",
"\n",
"top_countries.plot.bar(x='Country', y='Count', color=['green'])\n",
"plt.title('Top Countries by count of people')\n",
"plt.xlabel('Country')\n",
"plt.ylabel('Number of People')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Длительность жизни по полу"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAG9CAYAAAAFnjKbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA9xUlEQVR4nO3de5yN5f7/8feagzkfGGbMaJhBJYcwo40Q5TCOmSRb1Ay1aYc2TfTLLkTFJuRbyaFd7JRUvpJUYiMp5yk2OYSIMMZpzMmMOdy/P/xm/Vp7Zm7TzGKtmfV6Ph4es+7rvu5rfe613DPvx31f614WwzAMAQAAoERuji4AAADAmRGWAAAATBCWAAAATBCWAAAATBCWAAAATBCWAAAATBCWAAAATBCWAAAATBCWAAAATBCWABdx/PhxWSwWLV682KZ9zZo1atGihby9vWWxWJSWluaQ+m6WxYsXy2KxaNeuXY4uxWFK+78AoGSEJaAKKG8AuHDhggYMGCAfHx/NnTtXS5YskZ+f3w2q0jVt3rxZAwYMUJ06dVStWjUFBQWpdevWmjJlis6ePevo8gCUgYejCwBwc9SrV09XrlyRp6entW3nzp3KyMjQSy+9pC5dujiwuqpp4sSJeumll1S/fn0NGTJE9evXV05OjpKTkzVr1iz961//0tGjRx1dJoDrICwBLsJiscjb29umLTU1VZIUHBzsgIqqto8++kgvvfSSBgwYoCVLlqhatWo261977TW99tprDqrOvrKysjgjiSqNy3CAi/jveSqdOnVSYmKiJOmuu+6SxWLRkCFDrP23b9+u7t27KygoSL6+vurYsaO+//57mzEzMjI0ZswYRUVFycvLS6Ghoeratat++OEHa59OnT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bNrRZ9vHxsdvzA86OsATARoMGDSRdO5NRlnsvhYeHa8SIERoxYoRSU1MVExOjV155xSYsnT59utjHy3/++WdJUlRUlCRp+fLlql+/vlasWCGLxWLtN2nSJHvsVjGHDx/Wvffea13OzMzUmTNn1LNnT5t+CQkJSkpK0pkzZ7R06VL16tXL5vJfSW6//XbdeuutWrlypebMmVOmj9UXve6hoaF2u+dVvXr1tH79emVmZtqcXTp06JBNv6IzgZ6entxvCygBc5YA2IiNjVWDBg00c+bMYpeRJOncuXOSrn0a6/LlyzbrQkNDFRERodzcXJv2/Px8LViwwLp89epVLViwQLVq1VJsbKyk/3+m5PdnhrZv366tW7faZ8f+y8KFC20u9c2bN0/5+fnFzog9/PDDslgsGj16tH755RfTT8H93osvvqjz589r2LBhJX5C77/PgMXFxSkwMFBTp04tsX/R6/5H9OzZU/n5+Zo3b561raCgQG+88YZNv9DQUHXq1EkLFizQmTNn7PLcQFXCmSWgCnn33Xe1Zs2aYu2jR48u8xhubm765z//qR49eqhJkyYaOnSo6tSpo1OnTmnjxo0KDAzU559/royMDN1yyy3q37+/mjdvLn9/f/373//Wzp07NWvWLJsxIyIiNH36dB0/fly33XabPvroI+3evVsLFy60TrLu3bu3VqxYoQceeEC9evXSsWPHNH/+fDVu3LjE0FZRV69eVefOnTVgwAAdOnRIb731ltq3b6/777/fpl+tWrXUvXt3ffLJJwoODlavXr3KNP6gQYO0b98+TZs2TTt27NDAgQMVHR2trKws7du3Tx9++KECAgKsZ6kCAwM1b948Pfroo4qJidHAgQNVq1YtnThxQl988YXatWunN9988w/tY58+fdSuXTs999xzOn78uBo3bqwVK1YUC7mSNHfuXLVv317NmjXTsGHDVL9
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dfgender = df[df['Gender'].isin(['Male', 'Female'])]\n",
2024-09-13 17:47:57 +04:00
"dfgender[0:1000].boxplot(column='Age of death', by='Gender')\n",
2024-09-13 17:40:03 +04:00
"plt.title('Lifespan by Gender')\n",
"plt.suptitle('') # Убираем автоматический заголовок\n",
"plt.xlabel('Gender')\n",
"plt.ylabel('Lifespan')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Количество людей родившихся в тот или иной год"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Axes: ylabel='Frequency'>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAGdCAYAAAAPLEfqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA1EklEQVR4nO3de1jUZf7/8dcgB0E5hAoDX0EpMS1N8ZBLuZXJCmqup/2WLZWaq+2mldJJrlVLs1DLQ5bp2gH12sryKl2zb7SmpttKqCjZwS+exU0ObQQELgfl8/vDn/P7TYB+GEZmGJ+P65rr2rk/99zzHu+L5rX3557Px2IYhiEAAABckperCwAAAGgJCE0AAAAmEJoAAABMIDQBAACYQGgCAAAwgdAEAABgAqEJAADABEITAACACd6uLsAd1NbW6syZMwoMDJTFYnF1OQAAwATDMPTzzz8rMjJSXl5Xfh2I0CTpzJkzioqKcnUZAADAAadPn1bHjh2v+PsQmiQFBgZKuvCPHhQU5OJqAACAGWVlZYqKirJ9j19phCbJdkouKCiI0AQAQAvTXFtr2AgOAABgAqEJAADABEITAACACexpAgB4DMMwdO7cOZ0/f97VpcAJWrVqJW9vb7e5HBChCQDgEaqrq5Wfn6+zZ8+6uhQ4UUBAgCIiIuTr6+vqUghNAICWr7a2VidOnFCrVq0UGRkpX19ft1mdgGMMw1B1dbV++OEHnThxQrGxsc1yActLITQBAFq86upq1dbWKioqSgEBAa4uB07i7+8vHx8fnTp1StXV1WrdurVL62EjOADAY7h6JQLO505z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rKSkJFVVVWnfvn366aeflJKSotjYWOXl5Wn9+vXq37+/Pv74Y23cuNHhWtyFS/c07du3T3FxcYqLi5MkpaSkKC4uTnPmzJEkjR49WqtWrdKiRYvUs2dPvfHGG/rggw80cOBA2xhLly7VXXfdpbFjx+q2226T1WrVhx9+6JLPAwBAY2VkZCgiIkIREREaMGCA9u7dqw0bNuiOO+5o1Dhjx45VUlKSBg0apA4dOujdd99tUl2xsbG65ZZb1K1btzqn4f7whz/ojTfeUHp6unr27Knbb79da9asUUxMjCTpt7/9rWbMmKFp06apd+/e2r17t93lCloqi2EYhquLcLWysjIFBwertLRUQUFBThmTX88BQPOprKzUiRMnWsz1floCwzAUGxurhx9+WCkpKS6r41JzeyW+vy/Fbfc0AQAA1/jhhx+0fv16FRQU2K7NBEITAAD4hbCwMLVv316rV6/WNddc4+py3AahCQAA2GHnTv3c9uKWAAAA7oTQBAAAYAKhCQDgMTit5HncaU4JTQCAFu/ibULOnj3r4krgbBfn9Je3gnEFNoIDAFq8Vq1aKSQkxHYT2oCAAFksFhdXhaYwDENnz55VUVGRQkJCbPe1cyVCEwDAI1y8UfvF4ATPEBISYptbVyM0AQA8gsViUUREhMLCwlRTU+PqcuAEPj4+brHCdBGhCQDgUVq1auVWX7TwHGwEBwAAMIHQBAAAYAKhCQAAwARCEwAAgAmEJgAAABMITQAAACYQmgAAAEwgNAEAAJhAaAIAADCB0AQAAGACoQkAAMAEQhMAAIAJhCYAAAATCE0AAAAmEJoAAABMIDQBAACYQGgCAAAwgdAEAABgAqEJAADABEITAACACYQmAAAAEwhNAAAAJrg0NO3atUsjRoxQZGSkLBaLNm3a1GDfP/7xj7JYLFq2bJlde3FxsZKTkxUUFKSQkBBNmjRJ5eXlV7ZwAABw1XFpaKqoqFCvXr20YsWKS/bbuHGjvvzyS0VGRtY5lpycrG+//VZbt27
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from matplotlib.pyplot import xlim\n",
"\n",
"\n",
"df.plot.hist(column=[\"Birth year\"], xlim=(1900, 2000), bins=4000)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"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
}