204 lines
163 KiB
Plaintext
204 lines
163 KiB
Plaintext
|
{
|
||
|
"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",
|
||
|
"execution_count": 41,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkYAAALrCAYAAAAbX0hcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1gUV9sG8HvpdUGpdlEsYG9RbNGIomI3scaKLYJiN76JIpZobLG32DVGjTVqFBW7Yu8VOyYKdrAj8Hx/wM7HsgvsGhST3L/rmkuZPTtzZnd25pkzZ56jEhEBEREREcEkuytARERE9KlgYERERESUgoERERERUQoGRkREREQpGBgRERERpWBgRERERJSCgRERERFRCgZGRERERCkYGBERERGlYGBERFnm9u3bUKlUWLJkyUdb55IlS6BSqXDixImPts7/mu3bt6Ns2bKwsrKCSqXCs2fPsrtKf4tKpcLIkSOzuxr0iWJgRP8JKpXKoGnv3r0fpT5xcXEIDQ1FmTJlYGdnB2tra5QsWRJDhw7FvXv3PkodMvPHH3/w5PEPcvjwYYw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hxA5s2bcKOHTuwYMEC/PTTT5g7dy66detmcL0y4u3tjQoVKmDFihXo2LEjVqxYAQsLC7Rq1SpLlm+otB2sNT7k95Wd0m5vUlISVCoVtm3bpnfb7OzsPlbVlH3066+/Vjqap1W6dOmPVh/KfgyMiJCcf2fXrl14/vy5VqvRlStXlNdT03e7JzIyEjY2NhneXmrcuDF+/fVXrFixAsOGDcu0TkByq8Y
|
||
|
"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++OEHa59OnTqpadOmSk5O1t133y0fHx9FR0dr/vz5NmNdvXpVEydOVGxsrIKCguTn56cOHTpo48aNJe7HzJkztXDhQjVo0EBeXl666667tHPnzjK/HtnZ2XriiScUEhKiwMBAJSQk6NKlS9b1iYmJqlmzpvLy8opt261bN91+++2m40+cOFE1a9bUO++8UywoSVJQUJBefPHFYu1fffWVOnToID8/PwUEBKhXr1766aefbPoMGTJE/v7+OnXqlOLj4+Xv769atWpp7NixKigosOmblpamIUOGKCgoSMHBwUpMTCx1XtrBgwfVv39/1ahRQ97e3mrVqpVWrVpl06foku+mTZs0YsQIhYaG6pZbbjF9LYDKjrAEuKjnn39ew4cPlyRNmTJFS5Ys0RNPPCFJ2rBhg+655x6lp6dr0qRJmjp1qtLS0nTfffdpx44d1jH++te/at68eXrwwQ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XFxSkwMFBTp04tsX/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",
|
||
|
"dfgender.boxplot(column='Age of death', by='Gender')\n",
|
||
|
"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+8vHx8fnTp1StXV1WrdurVL62EjOADAY7h6JQLO505z6j6VAAAAuDFCEwAAbuzkyZOyWCzKyclx6PUWi0WbNm1yak1XK5fuadq1a5defPFFZWdnKz8/Xxs3btSoUaPs+hw6dEhPP/20du7cqXPnzumGG27QBx98oOjoaElSZWWlHn/8ca1fv15VVVVKTEzUa6+9pvDwcBd8IgCAO+k88+Nmfb+TC4Y3qv+ECRO0du1a2/PQ0FD1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OO+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
|
||
|
}
|