770 lines
1.1 MiB
Plaintext
770 lines
1.1 MiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "c3968b76-b939-4c1c-9b84-29e51f8ae69f",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Statystyki miliarderów\n",
|
||
|
"**Zbiór danych zawiera statystyki dotyczące miliarderów na świecie, zawarte są również ich dane osobowe, branże którymi się zajmują oraz firmy.**\n",
|
||
|
"\n",
|
||
|
"[Źródło](https://www.kaggle.com/datasets/nelgiriyewithana/billionaires-statistics-dataset)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 116,
|
||
|
"id": "cb8f7a05-40a5-46cf-8900-88da58e8690f",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import warnings\n",
|
||
|
"import pandas as pd \n",
|
||
|
"import seaborn as sns\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"plt.style.use('ggplot')\n",
|
||
|
"warnings.filterwarnings(\"ignore\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"id": "5a5c0cd6-6606-4983-b945-eeed8b5afe24",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"df = pd.read_csv('data.csv')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "222be866",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Analiza rozkładu majątków miliarderów w różnych krajach, branżach i regionach\n",
|
||
|
"\n",
|
||
|
"## Kraje"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9ce7d046",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Wykres pokazuje kraje z największą liczbą miliarderów. Jak możemy zauważyc na samym szczycie znajdują się USA, Chiny i Indie**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 27,
|
||
|
"id": "4a7a3ea1",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAApQAAAHNCAYAAACgpuueAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC0Q0lEQVR4nOzdd3xP1//A8dcnyScbSSRkkGUHaWwlRoUvJbYGVSNF1eiXohTVpgtB1UqNamtWktqktFbMGrVjxEyJJCJIkIis+/vDL5+vT5OQSOST8X4+Hh5y7z333Pe5+STezjn3XJWiKApCCCGEEEK8Ij1dByCEEEIIIYo3SSiFEEIIIUS+SEIphBBCCCHyRRJKIYQQQgiRL5JQCiGEEEKIfJGEUgghhBBC5IsklEIIIYQQIl8koRRCCCGEEPkiCaUQQgghhMgXSSiFEEIIUSz1798fY2Nj9uzZo+tQSj1JKIUo5UJDQ1GpVPj5+ek6lAK1fPlyVCoVy5cvL9B6/fz8UKlUhIaG5queQYMGoVKpiIiIKJC4dCmne+3s7Iyzs3OhxFCY13rdWrdujUql0tqX089pdmULm64+ywsXLuTXX39l9erVtGnTplCvLbKShFIIHVKpVDn+Y3D16lWqVKmCSqVi8uTJhRyZEEIUXX/99Rfjxo0jICCAXr166TocARjoOgAhRFYnTpygY8eOxMXFsWDBAkaNGvXartW4cWMuXryItbX1a7uGLnTv3p2mTZtiZ2dXoPWOGjWKPn364OjoWKD1lkS7d+/WdQjF0sqVK0lKSirwsiVJWFgYy5Yto3///roORfw/SSiFKGJ27txJjx49SElJITAwkHfeeee1Xs/U1JSaNWu+1mvoQrly5ShXrlyB12ttbV3iku/XpUqVKroOoVjKy39WSut/bIYOHarrEMS/yJC3EEXI2rVr8fb2Rk9Pjx07dm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TVr7W7Vqpfz7n+ecfk6zK5ucnKzcunUrS5zx8fFK7dq1FUtLSyUpKUnrWOb98/LyUh4/fqx17NGjR4qVlZViYGCgHD9+XOvYmDFjNL+TMj/LiqIo4eHhilqtVqpUqZLlPu7atUvR09NTunXrlm1b6tatm+VznRmDnp6esn//fq1jM2bM0PwMZ0pKSlKMjIyUhg0batWhVqs1P+vLli3THJs7d64CKCtXrsxy30TuSEIphA5l/iIGFLVarVy7di1X5xgaGip37tzJ8/Xq1q2ruLi4aO3Lb0K5YsUKBVAaN26c5R+pnGQmZVOmTMlybM+ePQqgjBs3Lld1ZWRkKGXLllXeeustrf3ZJTlPnjxRjI2NlXr16mn2ffLJJ4qBgYFy+PBhBVCWLFmiKMqzZMDCwkKpVq1atrE/n1Bm/mP0ySefZBtj7969FZVKpZUsPZ9QTp8+XVGpVIqnp6dy//79LOdnJpTh4eG5uifP8/X1VQDlo48+yvU5S5cuVQBlxYoVuSqfl4SyTp06CqCcPHky1/FketFnLTMh+ney8Xx8gwYNytV1XrX97733Xo4xt2jRIsux0NBQBVD8/Py09uc3oXyR7777LtvkOvP+ZfefltWrVyuAMmDAgCzH4uPjlXLlymVJKDMTzW3btmUbR7du3RR9fX3l4cOHWdry7wT7+Rj69u2b5Vhqaqri7OysAMo///yj2d+6dWtFT09P8zMVEhKiAEpISIhiY2OjVVfnzp0VQLl9+3a28YqXkyFvIYqA9u3b88cff/Duu++yY8cOLCwsXlje2dlZMwz0b4qisGbNGpYvX86ZM2d48OAB6enpmuOGhoYFFvfevXsZMmQILi4ubN26FRMTkzyd37Bhwyz7KleuDJBlXmRqaipLliwhMDCQCxc
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ppl_in_countries = df.groupby('countryOfCitizenship')['rank'].count().reset_index().sort_values(by ='rank',ascending=False).head(20)\n",
|
||
|
"ax = sns.barplot(ppl_in_countries,x='rank',y='countryOfCitizenship',orient='h',hue = 'countryOfCitizenship', legend = False, palette='rainbow')\n",
|
||
|
"ax.set_title('Kraj z największą liczbą miliarderów')\n",
|
||
|
"ax.set_ylabel('Kraje')\n",
|
||
|
"ax.set_xlabel('Liczba milarderów')\n",
|
||
|
"for container in ax.containers:\n",
|
||
|
" ax.bar_label(container, fontsize=8)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "af5b7d38",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Wykres obrazujący liczbę miliarderów biorąc pod uwage liczbe mieszkańców danego kraju**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 57,
|
||
|
"id": "06a5d02c",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABBsAAALDCAYAAABU/wi8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC6/0lEQVR4nOzdeVxU9f7H8ffAsCOLCoIrbrinZqKpKeJWau5lWbaYtmhZWt20a7lcy6xfy1VbLLW9m8t1yT3XTO1mWpZrhrgrCiEYoDAD5/eHl7kSoDAek2Fez8fDx8M553vOfM98zgzMm+/5HothGIYAAAAAAABM4nG9OwAAAAAAAMoWwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAAAAAAGAqwgYAgEvIyclRx44dVb58ee3evft6dwelxNy5c2WxWDR69Ojr3RXAdFu2bJGXl5cGDBig3Nzc690dACgRwgYAprFYLIqNjS1zz3WtRUVFKSoqKt+yjz76SBaLRR999NEV2/7VYmNjZbFY/vLnfe655/T9999r6dKlaty48V/+/K6mqHPoapS2992+ffs0dOhQDR48WK+//rrT+3nggQdksVh0+PBh8zpXTBs3bpTFYtGECROK1b40fDZcz8+hv+K5r8V7xxmnT5/WnXfeqfbt2+vzzz+Xh4dzv7ZPmDBBFotFGzduLFb76/l+kEr+ngBQelmvdwcAlG55XyoNw7jOPYE7W7Bggf75z39q0aJFatu27fXuDkqB9PR09e/fX+3bt9ecOXOuSwAGXCs5OTm66667FBkZqcWLF8vHx+d6dwkASoywAYBp9u3bJ39//+vdDZezbt26a9K2rDAMQ0ePHtXChQvVs2fP690dt1aa3uM///yz7rnnHo0aNUpW69X9OjNlyhSNGTNGVapUMal3fz13/Gwoy/bv36/Y2FgNHz5c5cqVu6p9Pf7447rrrrtUvXp1k3p3bcXExGjfvn2qWLHi9e4KgKtE2ADANPXr17/eXXBJtWvXviZtywquxy89StN7vG3btqaNcomMjFRkZKQp+7pe3PGzoSxr1KiRGjVqZMq+Klas6FJf3P39/UvVZw0A5zFnAwDTFHU9d05Ojt577z21bdtWwcHB8vPzU506dTR06FD99ttvkv53jebl/hV2venJkyc1ePBghYeHy8/PTy1atNAXX3xRoF12drZmzJih7t27q0aNGvLx8VH58uXVuXNnrVy5skTHeen1r//617/UokUL+fv7q3Llyho9erSysrIkSevXr1dsbKyCgoIUGhqqwYMH6/fffy+wv5Jcg1xY27S0NL322muKi4tT1apV5e3trbCwMPXq1UvfffddofvJq1ViYqKGDh2qKlWqyNPTM981yl9++aVatGghPz8/hYeHa/DgwTp58uRl+7d69Wp1795dFStWlI+Pj2rXrq1nn31WqampRR7LuXPnNHr0aEVFRcnLyyvfdbrr1q3TrbfeqvLly8vHx0fR0dEaM2aM0tLS8u3r7rvvlsVicZxPee6//35ZLBZ16tQp3/I//vhDXl5eat++/WWPR5IqV65c6F+8a9SoIYvFon/84x/5lq9cuVIWi0UvvvjiFfd9pXP+0tdix44devLJJ9W0aVOVL19evr6+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KSUlRV27dlVQUJBq1qwpSZo5c6Yee+wxBQQE6I477lB4eLg2btyoqVOnaunSpdqyZYtCQkIkSZ06ddKXX36pdevWqW7duo795w0t37p1qy5cuCBfX19J0jfffCO73V4ghChMXFycPv/8c+3fv9/x17b4+HgdPXrU8RwvvPBCgecszr4LO+cl6dNPP1VCQkK+c/6DDz7QokWL1KFDB3Xu3Fm5ubnasWOH3njjDa1cuVLff/99sYZb//jjj+ratatSUlLUrVs39evXT8nJyVq8eLHatWunRYsWqXv37pJU5PvSbrfrjTfe0Pnz5wu8L1NTU9W2bVt5e3trwIABysrK0vz58zVkyBB5eHjo/vvvz9d+8ODB+uKLL1StWjUNHTpUFotFixYt0vDhw7V582Z9/vnnjrarVq1Sjx49FBQUpF69eqlKlSpKSUnRvn379M477+Tr69mzZ9WxY0f9/PPPqlevnoYMGSJvb28dPHhQH374ofr16+c430vqhx9+UOfOnfXHH3+oV69eatiwofbv36/PPvtMS5Ys0dq1a9WyZUtH++TkZLVp00YJCQlq166d2rVrp1OnTunRRx9V165dnepDcRiGoQcffFAff/yxKlasqH79+iksLEzHjx/Xhg0bVK9ePd10000KCQkp8lycMWOGfv/99wJ1zs7OVufOnZWamqq77rpL2dnZ+ve//60nn3xSv/76q95++21JF0fDdOzYURs2bNCBAwcUHR2dbz9bt27V7t271b9//790dMlvv/2mm2++Wb///rtuu+02NWvWTPHx8erTp49uu+22Irez2Wzq1q2bTp48qdtuu01Wq1WLFy/WmDFjdOHChQKv4/PPP68pU6aoYsWKGjRokAIDA7Vy5Uo9//zzWr16tb7++mt5e3tLuhg0tGrVShaLRb169VLNmjV17tw5xcfH65133tHkyZPl5eUlqfg/W82ybt069evXTwEBAdq0aZOaNWuWb/3lfp4sXLhQ7733njp27Kg2bdrI29tbe/bs0axZs7R06VJt377dpS9hAnAZBgBchiSjuB8VkowOHTrkWzZ27FhDknH77bcbFy5cyLfuwoULxpkzZy67z/vvv9+QZDz11FOF9uuOO+4wcnJyHMsTEhKM0NBQw8vLyzh48GC+5zp27FiB/aemphqNGjUyQkNDjczMzGId5/jx4w1JRlBQkLF37958z9GwYUPDw8PDKF++vLFx40bHupycHKNz586GJOOnn37Kt78aNWoYNWrUyLfsww8
|
||
|
"text/plain": [
|
||
|
"<Figure size 1200x800 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ppl_in_countries = df.groupby(['countryOfCitizenship', 'population_country'])['rank'].count().reset_index().sort_values(by ='rank',ascending=False).head(20)\n",
|
||
|
"ppl_in_countries['population_country'] = ppl_in_countries['population_country'] / 1000000\n",
|
||
|
"ppl_in_countries['population_country'] = ppl_in_countries['population_country'].astype(int)\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(12, 8))\n",
|
||
|
"plt.scatter(ppl_in_countries['rank'], ppl_in_countries['population_country'], s=100, c='red', alpha=0.5)\n",
|
||
|
"\n",
|
||
|
"for i, txt in enumerate(ppl_in_countries['countryOfCitizenship']):\n",
|
||
|
" plt.annotate(txt, (ppl_in_countries['rank'].iloc[i], ppl_in_countries['population_country'].iloc[i]), fontsize=8)\n",
|
||
|
"\n",
|
||
|
"plt.title('Liczba miliarderów w zależności od liczby ludności kraju')\n",
|
||
|
"plt.xlabel('Liczba miliarderów')\n",
|
||
|
"plt.ylabel('Liczba ludności w mln')\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "b4d7574e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Ten sam wykres bez Chin, Indii oraz USA, dla lepszego zobrazowania innych krajów**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 58,
|
||
|
"id": "4827cd7e",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUg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Qpi7969KleunHx9fbVmzRrb9Lz+nhw6dEivvvqq7r33XgUEBMjd3V2VKlXSk08+qdOnT2d5npyu0c/tGC+sfQT+bTijD8BuKSkp6tSpk9asWaMKFSqob9++8vX11fHjxxUeHq5mzZrpzjvvVFBQkEaNGpVlfavVqo8++khXr17N0mX48uXLatKkiYoXL67HH39csbGxmj9/vvr166czZ87opZdesi176dIlPf/882rSpInatGmjgIAAnTt3TkuWLFGHDh00bdo0DRo0qED7NnnyZK1YsUIPPfSQQkNDtXr1av33v//VpUuX1KVLF/Xp00cdO3bUk08+qe3bt+urr75STExMgb9YyMuBAwf0+uuvq3nz5urYsaP8/f118uRJ/fjjj1qxYoWWLFmi9u3bZ1nv0qVLaty4sXx8fNStWze5uLioTJkykqT//ve/GjFihIoXL64BAwaoePHiWrVqlZo0aSI/P79s6xgzZoxGjx6tEiVKqFOnTipdurR+++03ffjhh1q+fLl++ukn+fr6ZlonJSVFYWFhunTpktq2bStfX19VrlxZkjR16lQ988wz8vb2Vs+ePVW6dGlt3LhREyZM0JIlS7Rt2zYVL15cktSqVSt99913Wrdune68807b9jO6M2/fvl1Xr16Vh4eHJGnTpk1KTU3N8gVAdsLCwvT111/r4MGDtrNMhw8f1smTJ23P8eabb2Z5zvxsO7tjXpLmzp2ro0ePZjrmp02bpvDwcLVo0UKtW7dWenq6du3apY8++kgrVqzQL7/8kq8uvrt371bbtm116dIltWvXTt26dVNMTIwWLVqkZs2aKTw8XB06dJCkHN+Xqamp+uijj3TlypUs78vY2Fg1bdpUbm5u6tGjh5KTk7VgwQINHDhQLi4uevTRRzMt379/f33zzTeqUKGCBg0aJJPJpPDwcA0ZMkRbt27V119/bVt25cqV6tixo3x9fdW5c2eVK1dOly5d0oEDB/Tpp59mqvXy5ctq2bKl9u7dq7vuuksDBw6Um5ubjhw5olmzZqlbt262472gduzYodatW+uvv/5S586dVatWLR08eFBfffWVFi9erLVr16phw4a25WNiYtSkSRMdPXpUzZo1U7NmzXTu3Dk9/fTTatu2rV015IdhGHr88cc1Z84clSpVSt26dVNAQIBOnz6tDRs26K677tK9996r4sWL53gsTpkyRX/++WeWdk5JSVHr1q0VGxurPn36KCUlRT/88IOef/55/f777/rkk08kXesF0rJlS23YsEGHDh1S9erVM21n+/btioqKUvfu3W9pr4o//vhD9913n/7880898MADqlevng4fPqyHHnpIDzzwQI7rWa1WtWvXTmfPntUDDzwgs9msRYsW6dVXX9XVq1ezvI6vvfaaxo8fr1KlSqlv377y8fHRihUr9Nprr2nVqlVavXq13NzcJF0L+SEhITKZTOrcubMqV66s+Ph4HT58WJ9++qnGjRsni8UiKf9/WwvLunXr1K1bN3l7e2vz5s2qV69epvm5/T1ZuHChPv/8c7Vs2VJNmjSRm5ub9u3bp+nTp2vJkiXauXOnQ182Azg0A8C/liQjvx8DkowWLVpkmjZy5EhDkvHggw8aV69ezTTv6tWrxoULF3Ld5qOPPmpIMl544YVs6+rZs6eRlpZmm3706FHD39/fsFgsxpEjRzI916lTp7JsPzY21qhdu7bh7+9vJCUl5Ws/R40aZUgyfH19jf3792d6jlq1ahkuLi5GiRIljI0bN9rmpaWlGa1btzYkGXv27Mm0vUqVKhmVKlXKNG3WrFmGJGPWrFl5LhsbG2tcvHg
|
||
|
"text/plain": [
|
||
|
"<Figure size 1200x800 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ppl_in_countries = ppl_in_countries[3:]\n",
|
||
|
"plt.figure(figsize=(12, 8))\n",
|
||
|
"plt.scatter(ppl_in_countries['rank'], ppl_in_countries['population_country'], s=100, c='red', alpha=0.5)\n",
|
||
|
"\n",
|
||
|
"for i, txt in enumerate(ppl_in_countries['countryOfCitizenship']):\n",
|
||
|
" plt.annotate(txt, (ppl_in_countries['rank'].iloc[i], ppl_in_countries['population_country'].iloc[i]), fontsize=8)\n",
|
||
|
"\n",
|
||
|
"plt.title('Liczba miliarderów w zależności od liczby ludności kraju')\n",
|
||
|
"plt.xlabel('Liczba miliarderów')\n",
|
||
|
"plt.ylabel('Liczba ludności w mln')\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "e10a109a",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Branże\n",
|
||
|
"\n",
|
||
|
"**Wykres kołowy pokazujący ile procentowo milliarderów uzyskało swoje bogactwo z jakiej branży. Widać na niej że topowe dziedziny to: finanse, manufaktura i technologia**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 60,
|
||
|
"id": "9fcfd47a",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwYAAAIACAYAAAA46Ht9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1xV9f/A8de9l8veAiI4cODeOUpzpeYoTc0ysxzZtGVlqVmOhtkw2/0qv2lmppUj9565F04cqIjI3vvO8/sDuUmgggKH8X4+HjyEM9/ngvee9/mMt0ZRFAUhhBBCCCFElaZVOwAhhBBCCCGE+iQxEEIIIYQQQkhiIIQQQgghhJDEQAghhBBCCIEkBkIIIYQQQggkMRBCCCGEEEIgiYEQQgghhBACSQyEEEIIIYQQSGIghBBCCCGEQBIDIcR/dO/eHY1Gk2/Z9u3b0Wg0TJ8+/ZbblrXRo0ej0WgIDw9XNY6KJigoiKCgILXDuG3h4eFoNBpGjx6tyvnLw9++EEKUNEkMhKhENBoNGo0GrVbLhQsXbrhdjx49bNvOnz+/7AIUQgghRLllp3YAQoiSZWdnh9ls5n//+x8zZ84ssP78+fNs377dtt1/LViwgKysrCKdqzjbClGSAgMDCQ0NxcPD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ZMSIEWRnZ+Pu7g7ATz/9xPLly+nWrRu9evXCarVy+PBhPv/8c9atW8f+/ftxc3MrcMzVq1fz999/069fP55//nlOnz7N2rVrOXjwIKdPn8bHxweA1q1bF/p7SEtL48svvwTA0dHRtvyFF16gWbNmdO3alRo1apCYmMjatWt58sknOXv2LO+//36+41y6dIkePXpw+fJl7rrrLl544QWsVivnzp1jzpw5PP/887i4uOTb5/HHH2fXrl3069cPd3d31q5dyyeffEJcXBzz5s0r8u9CCCHKBUUIUWkASmBgoKIoijJ27FhFp9MpV65csa3v06eP4u7urmRmZipTpkxRAGXevHn5jtGtWzflv28N27ZtUwBl2rRpt9w2Jycn3znzpKSkKM2aNVO8vLyUrKysfOvq1KmjAErPnj2VjIyMfOvS09MVb29vxc7OTjl48GC+dePHj1cABVAuXbpkW3727FlFr9cr9evXVyIjI/Pts3nzZkWr1SqDBg0q9FpatGihxMfHF4i/MFOnTlUAZciQIYrFYlEURVGioqIUOzs75a677iqw/bx58xRAefvtt2957KysLMXBwUFp166dbVl6erqi1+uV3r17K4Ayd+5c27ovvvhCAZQFCxYUKfa817xz585KTk6ObXliYqJSr149BVB27NhhW37p0iXbaz158uRCjxkeHq6YzeYCy+fOnasAyqxZs/Itz3s9dDqdsnnz5nzrJk2apADKxx9/fNPrMJlMyv33368Aypw5c/KtCwsLK7C9wWBQ7rvvPsXOzq7A38Y999yjAMrMmTML7BcfH69kZ2fbfs77e2nbtq2SmJhoW56RkaHUr19f0Wq1SnR09E1jF0KI8kYSAyEqkesTg3379imAMmPGDEVRcm/atFqt8sILLyiKopRaYnAzs2fPLnDDqSj/3qSGhIQU2GfhwoUKoIwcObLAupSUFMXDw6NAYpCXMKxevbrQOAYNGqTodDolLS2twLWsWLGiSNfyyy+/KIDSoUOHAonO0KFDFUA5dOhQvuV33323otVq88V6M927d1e0Wq2SlJSkKIqirFmzRgGUNWvWKL6+vsrw4cNt2w4YMEABlKtXrxbp2Hmv+c6dOwusy7thHz16tG1ZXmJQvXr1fIlEUVitVsXd3V3p0aNHoecZMWJEgX0uXryoAMrDDz9802M//fTTCqC8+OKLRY5n6dKlCqD88ssvtmWHDh1SAKV169a2JO9m8v5eNm3aVGBdXsK4atWqIsckhBDlgXQlEqKS6tixIy1atODnn3/mnXfeYe7cuVit1gLdW0rDqVOn+PTTT9m5cyfR0dHk5OTkW3/16tUC+zg6OhbaLejIkSMAdOvWrcA6Dw8PWrduzY4dO/It37t3LwA7duzg4MGDBfaLi4vDYrFw7tw57rrrrnzrOnTocIurg23btvH0009Tt25dVq1ahZOTU77148aN46+//uKHH37gxx9/BODEiRPs27ePfv36Fbl+wH333cf27dvZvn07gwcPZuvWrej1erp160aPHj3YunUrABaLhZ07d9KoUSMCAgKKdGzIncGqU6dOBZZ3794dgKNHjxZY16pVKxwcHAo9nslk4ocffmDx4sWcPn2a1NRUrFarbX1hv3eAdu3aFVhWq1YtgELHJuT56KOPmDt3Lg888ICtK9H1IiIi+Pjjj9myZQsRERFkZ2fnW399PPv27QOgT58+aLVFH353u7ELIUR5JImBEJXYM888wyuvvMK6deuYN28ed911F23atCnVc+7bt4/77rsPs9lMz549GThwIO7u7mi1WkJCQvj7778xGAwF9vPz8yt00HNqaiqQO9tSYfz9/QssS0xMBODTTz+9aayFDRAu7HjXCw0NZciQIbi4uLBmzRr8/PwKbNOjRw+aNGnC77//zuzZs3Fzc7MlCM8999xNj3+9nj17MnXqVLZs2cLgwYPZsmULHTt2xMXFhZ49e/LHH39w8uRJMjMzSU1NZcSIEUU+NoCPjw86na7A8rzXIO+1L2xdYYYNG8by5cupV68eDz30EP7+/rYk4osvvij09w7g6elZYJmdXe7Hk8ViKXSfxYsXM2XKFFq3bs3ixYsLXMfFixfp0KEDycnJdOnShfvvvx8PDw90Oh3h4eH88ssv+eJJSUkBcqdBLY7biV0IIcorSQyEqMSefPJJJk6cyPPPP8/Vq1eZOnVqqZ/zgw8+IDs72zbLzPU++ugj/v7770L3u9FMSHnz1MfGxha6PiYm5ob7pKam2gbGFtXNZmSKi4ujf//+ZGVlsWHDBpo0aXLDbZ9//nleffVVfvvtN0aNGsXChQs
|
||
|
"text/plain": [
|
||
|
"<Figure size 800x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=(8, 6))\n",
|
||
|
"df['category'].value_counts().plot(kind='pie', autopct='%1.1f%%')\n",
|
||
|
"plt.title('Miliarderzy w branżach')\n",
|
||
|
"plt.axis('equal')\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9040b7ce",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Wykres słupkowy pokazujący dokładną liczbę milliarderów na daną branże**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 61,
|
||
|
"id": "75aa4c8f",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuQAAAHMCAYAAACds72jAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAADTC0lEQVR4nOzdd1gUV/vw8e/SQYKAgDQFbNjF3lARUWKPJdhibxF91MQWNcYWNdiiWGJNrBGNNWrsEXtL7ESNXQEBEQUVF8Hd9w9f5udKEQSzKvfnunKFmTnnzH3GXbj37JkzKq1Wq0UIIYQQQgihFwb6DkAIIYQQQoi8TBJyIYQQQggh9EgSciGEEEIIIfRIEnIhhBBCCCH0SBJyIYQQQggh9EgSciGEEEIIIfRIEnIhhBBCCCH0SBJyIYQQQggh9EgSciGEEEIIIfRIEnIhhHgDHx8fVCqVvsN4Z97X/t26dQuVSkW3bt1y1E5oaC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LKPHj2idu3a/PPPP1StWpXBgwcTGxvLunXraNSoET/99BN9+/bN0TlyS1xcHIMGDaJWrVo0bNgQe3t77t27x9atW2nSpAmLFy+mV69eaeo9f/4cX19f4uLiaNSoEVZWVnh4eCjHk5OT8ff3JzIyksaNG2NkZMTmzZv55ptvUKvVjB079o2xPXr0CF9fX86cOUOlSpXo0aMHGo2GXbt20bFjR8LCwvj+++8zbePevXtUrVqVhIQEmjRpQps2bVCr1dy8eZOVK1cyYMAAChQogLW1dYYxzZ07lwcPHmBhYaHsO336NI0aNSIuLg5/f39at25NbGwsmzdvxtvbm02bNtGkSZM39jE9arWaTp06sXHjRvr3709wcDAGBi/H1YKCgrh8+TK1atWiadOmqNVqjhw5wrhx4wgNDWXv3r0YGhoCMHjwYDZv3syBAwfo2rVruglsdq+xVqulTZs2bN++neLFizNgwACSk5NZtmwZYWFh6fbnbd8Px44dY8qUKXh7e9OjRw9iY2MxMTHJ9Nr16NGDX375BVdXV9q0aYO1tTXHjx9nzJgx7Nu3jz179mBklPWU6KuvvuLgwYMEBATQsmVLdu3axaxZszh06BCHDx/GzMwsw7rZfU1B9t83P//8M3369MHU1JQWLVpQqFAhrl69ypIlS9i6dSvHjx9XvvnL6ntBvGNaIYT4AAFaFxcXrVar1f72229aQNuqVSudMm5ublpAm5ycrLP/2rVradpLSkrS+vr6ao2MjLTh4eE6x+rVq6d9/dfl/v37tYAW0M6ZM0fn2ObNm7WAtlixYtoXL14o+/v06aMFtH369NFqNBpl/7///qu1srLSmpiYaG/evJmjc3Tt2lUL6LTzentjx459Y//UarX27t27adp49OiRtkyZMlobGxttYmKizrHU692gQQPtkydP0tRNPd64cWOdutHR0dr8+fNr8+fPr33+/Lmy/+bNm1pA27VrV512UvsYFBSks//Zs2daf39/rUql0p45cybTfgcHB2sB7axZs9LE+eTJkzR9e913332nBbStW7dWrn9ycrK2aNGiWlNTU21oaKhO+YiICK2zs7PW0dFRq1arM207vb4/ePBAW7t2ba1KpdL+8MMPacpfv35d5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ZOt19v+36oVq1alvuSmJjIuXPnsLOzY9asWemWMTU1fePr5XXpvd+KFClCoUKFuHXrFo8ePcLa2jpLbWX2mkqVnfdN6uvwwIED6d63EBMTw4sXL/j333+pXLnyW78XRO6ShFwI8VGoWbMmbdu2Zf369axdu5Z27dqlW+7GjRtUq1aNhw8fUqdOHRo1akT+/PkxNDTk1q1bLF++PFs3eRUsWDDd/Y6OjsDLm9Ze/b+Tk1O65VP3P3r06K3PkZuOHz+Or68
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"categories = df.groupby('category')['rank'].count().sort_values(ascending=False).reset_index().head(20)\n",
|
||
|
"ax = sns.barplot(categories,x='rank',y='category',orient='h',hue = 'category', legend = False, palette='rainbow')\n",
|
||
|
"ax.set_title('Najpopularniejsze kategorie biznesu')\n",
|
||
|
"ax.set_ylabel('Kategoria')\n",
|
||
|
"ax.set_xlabel('Liczba osób')\n",
|
||
|
"for container in ax.containers:\n",
|
||
|
" ax.bar_label(container, fontsize=8)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "c3cbffad",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Wykres pokazuje wiek oraz branże miliarderów, jest bez dwóch wartośći odstających by lepiej go zobrazować: Bernard Arnault - 211mld, Elon Musk- 180mld.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 88,
|
||
|
"id": "220f880e",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0wAAAHMCAYAAADmsihGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6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Zj33zzjQqoc+bMsR3z9fVVn3/+efWNN95Q9Xq9Gh8fr6qqqq5atUoF1Pfffz/d+ua0Lqkf7KtXr/7A/O+X0XN2v0mTJqmA2rFjxywH++kFTMOGDVMBdfbs2Q+8PjVgCgwMVM1mc5rzpUqVUgsXLpyluqjq3feRVqtVz5w5k+Zc6mv03sAsN9o1tZy33347zTWRkZEqoL7++usZ5msymdQ2bdqogDpz5sws12fWrFkqoP76669ZvwkhhBCqqqqqDMkTBUZYWBjfffcdkZGRPP/88xw/fpyrV6/y2muv2dI0a9aMzZs3Y7Va0Wg06c5fSk9iYiJ///03RYoU4eOPP043jZOTE8ePH09z/Pr16zRq1IgzZ87w3Xff0bNnz4e6v3LlyuHh4WF3TKvV4ufnR0JCAsHBwWmuKVGiBL///vtDlZeZhIQE5syZww8//MDJkyeJi4tDVVXb+fvnYaSqW7dummP//PMPiYmJNGnSJN1FFpo1a5ZmLtOePXuAu/N80tuT5ubNmwDpPh/p1eHEiRMkJibSqFEjChUqlOZ8WFgY7733HgcPHrQ7BneH2o0YMYIjR45w48YNWrRoQUBAAB9++CG//fYbzzzzjO11lnp
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"top_20 = df.sort_values('finalWorth', ascending=False).iloc[2:50]\n",
|
||
|
"color_palette = ['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#8b00ff']\n",
|
||
|
"ax = sns.scatterplot(top_20,x='age', y='finalWorth', size='finalWorth', hue='category', palette=color_palette, sizes=(40, 400), legend='full')\n",
|
||
|
"ax.set_title('Wiek miliarderów oraz ich branża')\n",
|
||
|
"ax.set_ylabel('Majątek')\n",
|
||
|
"ax.set_xlabel('Wiek')\n",
|
||
|
"hand, labl = ax.get_legend_handles_labels()\n",
|
||
|
"unique_values_set = set(df['category'])\n",
|
||
|
"handout=[]\n",
|
||
|
"lablout=[]\n",
|
||
|
"for h,l in zip(hand,labl):\n",
|
||
|
" if l in unique_values_set:\n",
|
||
|
" lablout.append(l)\n",
|
||
|
" handout.append(h)\n",
|
||
|
"ax.legend(handout, lablout,bbox_to_anchor=(1.49, 1), loc='upper right', borderaxespad=0)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "e963e59e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Regiony\n",
|
||
|
"\n",
|
||
|
"**Przedstawienie z której częsci USA wywodzą się miliarderzy. Milarder zamieszkujący U.S. Territories to Stephen Deckoff, zamieszkuje on Wyspsy Dziewicze**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 83,
|
||
|
"id": "e5265785",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABIwAAAJsCAYAAACfwjgXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAACMS0lEQVR4nOzdd3xUVf7/8fdMeg8loYSWAKGHIghSQxNEVJCqoAhiQWzr4roKorCwNuzALrpIExVBUFCKKE06iPQmzdAiCYT0hCRzf3/wy3y5JtEkTjKT+Ho+Hj7MnFvmcyZzEuadc8+1GIZhCAAAAAAAAPj/rM4uAAAAAAAAAK6FwAgAAAAAAAAmBEYAAAAAAAAwITACAAAAAACACYERAAAAAAAATAiMAAAAAAAAYEJgBAAAAAAAABMCIwAAAAAAAJgQGAEAAAAAAMCEwAgA4HIsFkuR/4uOjnZ22ZLyr93Hx0d16tTR0KFDtXnzZmeXKEmqU6eOL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jlz5hTY56K66aabTPVK5nV80tLSNHHiRDVq1Ei+vr551rf57LPP1L17d1WsWNH+Hhk1apSOHz9e4HOePXtWo0aNUrVq1eTt7a369etr/PjxSk9PL/CYP1pb6o/W0lm3bp0GDRqkGjVqyMvLSyEhIWrTpo1eeuklXb582b5fQWsY/ZnvpSQdPHhQAwYMUOXKleXr66tmzZrpnXfekc1mK5F1s3Iv+5Sk7Oxs07aC1jAqjj963Yv6/rjxtVi/fr1uvfVWVahQQT4+PmrVqpV9/P7WL7/8otdee03dunWz/7wKDg5Wx44dNWvWLNlstnyPK8zPga+++krdunVTxYoV86yvlZCQoJdeekktWrSw/0xo1qyZpkyZorS0tDzntdls+uCDD9ShQwcFBwfLw8NDoaGhat68uZ544olys3YaAJR3rGEEACjzdu3apd69e+vKlSuqVauW+vXrp8TERG3YsEFbt27VsmXLtHz5cnl6euY5NiEhQW3bttXly5dNCxG/8847WrVqlX744QeFhIQ4pE6bzaaUlBRJUpUqVUzbsrOzNWzYMH3++efy8vLSTTfdpLCwMB0/flwLFy7U0qVLtXTpUvXu3dt03GeffaZhw4bJZrOpWbNmatq0qc6fP6+RI0f+bshUkCtXrqh79+7au3evAgMD1a1bN3l4eGjjxo2aOnWqPvnkE61bty7fBYMlaeTIkfrkk0/UqVMn9e3bV3v37tXatWu1adMmbdy4UW3btrXve/DgQXXo0EFJSUlq0KCB+vbtKzc3N507d06bNm2y98MRkpKS7F97eXmZtmVkZCg6OlqHDx9W586d1bx5c3u4YhiGHnjgAc2fP1/u7u7q3LmzQkNDtWfPHs2ZM0eLFi3SF198kef7cvToUXXp0kWXLl1StWrVdOeddyo1NVVvv/221q9f75A+/daTTz5pn8XWokULderUSYmJiTp27JgmT56srl27Funyt6J8LyVp48aNuu2225Senq66deuqZ8+eunz5sp577jlt377dkV2127lzpyTJ09NT9erVK5Hn+D3FfX/k+uijjzRlyhS1atVKvXv31pkzZ7R9+3aNGDFCV65c0dNPP23af8GCBXrxxRcVHh6uyMhIdejQQRcvX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G5KMW265Jd9jxo0bV6TA6JdffjGsVqthsViMffv25Tnm3Llzhre3tyHJ2LJli739xpBh+fLleY67ePGiIcnw8vIyBXp9+vQxJBl79uzJt/6iKCgwunDhgjFz5kx7sHbnnXfat934ntq0aVO+5839sPzee+/l2Waz2YyoqChDkjF16lR7++bNmw1Jhp+fnyl0y7Vs2TKHBkZZWVlGSEiIIcn44osv8j3utwo
|
||
|
"text/plain": [
|
||
|
"<Figure size 1400x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"region_counts = df['residenceStateRegion'].value_counts()\n",
|
||
|
"top_regions = region_counts.head(10)\n",
|
||
|
"\n",
|
||
|
"colors = sns.color_palette(\"pastel\")\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(14, 6))\n",
|
||
|
"sns.barplot(x=top_regions.index, y=top_regions, palette=colors)\n",
|
||
|
"plt.title('Top Regions Producing Billionaires', fontsize=16)\n",
|
||
|
"plt.xlabel('Region', fontsize=12)\n",
|
||
|
"plt.ylabel('Number of Billionaires', fontsize=12)\n",
|
||
|
"plt.xticks(rotation=45, fontsize=10)\n",
|
||
|
"plt.yticks(fontsize=10)\n",
|
||
|
"plt.grid(axis='y', linestyle='--', alpha=0.7)\n",
|
||
|
"\n",
|
||
|
"for i, v in enumerate(top_regions):\n",
|
||
|
" plt.text(i, v + 5, str(v), color='black', ha='center', va='bottom', fontsize=10)\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "69364ac4",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Analiza demograficzna: Przedstawienie wieku, płeci i miejsca urodzenia miliarderów.\n",
|
||
|
"\n",
|
||
|
"## Wiek\n",
|
||
|
"\n",
|
||
|
"**Wykres pokazujący ile miliarderów jest w danym wieku**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 101,
|
||
|
"id": "ab4e1d19",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABl0AAAIpCAYAAAAo6P5+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC0vklEQVR4nOzdeXxcdb3/8fc5Z9bse9u0TVdI2UpLW6BYLCKUXUHQqshy3fCHVfCKyEVlVcB7we2iV1FkX68gyL6reEGWCpSW0j1N23TJvs1klnPO749ppg1N22Q66cwkr+fj0UeT75yZ+XxmJpOZvOf7/Rqu67oCAAAAAAAAAADAPjEzXQAAAAAAAAAAAMBwQOgCAAAAAAAAAACQBoQuAAAAAAAAAAAAaUDoAgAAAAAAAAAAkAaELgAAAAAAAAAAAGlA6AIAAAAAAAAAAJAGhC4AAAAAAAAAAABp4Ml0AQAAAACA3NTZ2am77rpLPp9PF154oXw+X6ZLAgAAADKKmS4AAAAAgJRceeWVuvXWWzV27FgCFwAAAECELgAAAEBWq6+vV21traZNm6aWlpZ+j3n88cdVW1ur2tpaPf744/0e09LSomnTpqm2tlb19fWSpEcffVS1tbW64oor0lLrFVdcodraWj366KNpubyhcvzxx6u2tlYbN27sM767+tN9O6VDNtzWd955p55//nlddtllOu200zJWBwAAAJBNCF0AAACALFZTU6MxY8bIdV29+eab/R7zxhtvJL/e0zGu62rMmDGqqakZkloxcrz33nu6+eabde655+qrX/1qpssBAAAAsgZ7ugAAAABZ7qijjtJjjz2mN954QyeffPIup7/55psqKyuTz+fbbejSO37UUUclx0488UQdfvjhKiwsHJrCs9Sdd96pWCymUaNGDej4kXo77cnq1av17//+77rwwgszXQoAAACQVQhdAAAAgCy3c+jyUZs3b9aGDRt00kknyefz6YknntDmzZs1ZsyYPsf1nnfn0KWwsHBEBgmDnekzUm+nPTn77LMzXQIAAACQlVheDAAAAMhyvUHJmjVr1NTU1Oe0ncOUI488ss9Yr6amJq1Zs6bPZUl736tk69atuvHGG3XKKafo8MMP18yZM3X22Wfr3nvvVTweH1QPf//733XEEUfosMMO01NPPTWg8+y8b8natWt16aWXau7cuZoxY4bOPvtsvfjii8lj33vvPX3jG9/Q0UcfrenTp2vhwoV6/fXX+73c3e3psjt7up2ef/55/eAHP9Dpp5+uOXPm6LDDDtPxxx+v//iP/9DatWv32tfKlSt16aWXat68eTrooIP03//938nj2tra9JOf/ESf+MQndOihh+q4447Tddddp7a2tr3W/Prrr2vRokWaN2+eDj30UM2dO1ff/OY39c477/R7fO+eQJL0yCOPaOHChZo1a9Yut9OSJUt0ySWX9Lncb3zjG/q///u/XS7zxhtvVG1tre64445dTjv11FNVW1urc845Z5fTbr31VtXW1uqXv/zlXvsEAAAAsg2hCwAAAJDlxo4dq3Hjxknadc+W3u/nzJmjOXPmSNo1dOk9Zty4cRo7duyArvOtt97SGWecoTvvvFORSETHHHOMjjjiCG3YsEHXX3+9LrroIsVisQFd1oMPPqhvfOMb8nq9uuOOOwa96foHH3ygs88+Wx9++KHmzp2radOmaenSpVq0aJGeffZZvfjiizr33HO1detWzZ07V5MmTdK7776rr371q3r77bcHdV2Ddemll+qpp56S3+/X0UcfrXnz5sk0TT366KM6++yz9a9//Wu3533nnXd09tlna8mSJZo9e7bmz5+v/Px8SYmgbOHChbr77rvV3d2tT3ziEzrkkEP0xBNP6LOf/aza29t3e7k//elPdeGFF+qll17SmDFj9MlPflLjx4/XSy+9pHPPPVePPPLIbs97/fXX64c//KEsy9Jxxx2nww8/XIZhSJIefvhhLVy4UM8++6wqKyt10kknacKECXrllVf05S9/WbfeemufyzrmmGMkSa+99lqf8a1btyZDwGXLlqmjo6PP6b1hWe/5AQAAgFzC8mIAAABADjjqqKO0ceNG/fOf/9Spp56aHO/dz+WAAw6QYRiqrKzcJZjpb2mxPWlsbNSiRYvU0dGhq6++Wp///OdlmonPa7W2turSSy/VP/7xD/3ud7/TokWLdns5ruvq5ptv1h/+8AfV1NTotttu06RJkwbbuu655x5deuml+sY3vpEMAO655x79+Mc/1o033qhwOKwf//jHOvPMM5PnueGGG3TXXXfp17/+db8zLdLl5ptv1nHHHae8vLzkmOu6uv/++3Xdddfpqquu0hNPPJGse2cPP/ywvv71r+s73/lO8vbtdd1116murk6zZ8/Wb3/72+TyZm1tbfr617+ul19+ud96Hn74Yf3xj3/UhAkT9Ktf/UrTpk1LnvbWW2/poosu0tVXX61Zs2Zp4sSJu5z/scce0wMPPKAZM2b0GV+xYoWuvfZaua6rn/70p31u67/97W/65je/qf/+7//WzJkz9bGPfUxSIgj0er16++23FY1G5fP5JO0IVWpra7VixQr985//1IIFCyRJoVBI7733nvLy8napAQAAAMgFzHQBAAAAckBvYLLzLJaGhgZt2LBBc+bMSf5Rf86cOdq4caM2bdqUPG6woctdd92ltrY2nXvuufriF7/YJxAoLS3Vf/7nf8rr9eq+++6T67r9XkYkEtF3vvMd/eEPf9CMGTP00EMPpRS4SNL06dP7BC6S9IUvfEElJSXasmWL5s6d2ycEkKT/9//+n6RE0DDQGTmpOPXUU/sELpJkGIbOPfdczZw5U6tWrUrO6vioiRMn6tJLL90lcNm8ebNeeOEFGYaha6+9ts9+MiUlJbr22mv7vTzHcZLLk/3sZz/rE7hIicfGxRdfrFgspoceeqjfy/jyl7/cb9hx9913Kx6P68QTT9zltp4/f74WLlwoSbr99tuT43l5eTr88MMVCoX07rvvJsd7Z75897vflaQ+S5P13l+zZ8+W1+vtt0YAAAAgmxG6AAAAADng6KOPliTV1dVp27ZtkvouLdar9+ve0xobG7Vu3bo+l7E3f/vb3yRJp5xySr+njxo1ShMmTFBLS4vq6up2Ob21tVUXXHCBnnnmGS1YsEB33XWXysrKBnTd/fn4xz++y0wRj8eTXCpt/vz5u5yntLRUJSUlisViA9oDZV+sX79e9957r37yk5/oyiuv1BVXXKErrrgiuf9O7+3/USeccIIsy9pl/K233pLjODr44IM1derUXU4/6KCDkvuv7OyDDz7Qtm3bVFNTo0MPPbTf6+zd92d3e7ucfPLJ/Y73Pp7OOuusfk/v3Zvl7bfflm3byfG5c+dK6rvE2Ouvv64JEyZo/vz5qqqq6rP3Tu9xLC0GAACAXMXyYgAAAEAOGDVqlCZOnKi6ujq98cYbOuOMM5IzWHr/kL7z12+++abOOuus5B/LJ06cqFGjRg3oujZs2CBJOvfcc/d6bEtLyy4zWH72s58pHo9r3rx5+uUvf7nLTI7BGjNmTL/jvfuf7On0trY2RSKRfbr+3bFtW9ddd50eeuih3c74kaSurq5+x3e3v86WLVskKbmPT3/GjRunFStW9Bnrvd/q6+v7DWV21tLSMqiatm7duseaxo8fLykxw6mtrU3l5eWSEuHJf//3f+v111/XpZdeqtWrV2vbtm36whe+ICkRyjz++OPatGmTxo4dmwxdesMaAAAAINcQugAAAAA54qijjuoTurz55psqKSnRgQcemDxm6tSpKisrSwYyg11aTEosUyVJJ5100i5LZ31USUnJLmMnn3yyXnzxRb322mt69NFHk7MgUrW30GZfQ51U3X333XrwwQdVWVmpK664QjNnzlRFRYX8fr+kxPJZTz755G4DmUAgkNZ6eq+nsrJS8+bN2+OxpaWl+6Wm6dOnq6CgQO+//746OzuToUrvvi/HHHOMHn/8cb322ms6/vjjtWrVKpWXl+81NAIAAACyFaELAAAAkCOOOuooPfTQQ3rjjTfU0NCgjRs36sQ
|
||
|
"text/plain": [
|
||
|
"<Figure size 2000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=(20, 6))\n",
|
||
|
"sns.histplot(data=df[df['age'].notnull()], x='age', bins=30, color='skyblue', kde=True)\n",
|
||
|
"plt.title('Wiek miliarderów', fontsize=16)\n",
|
||
|
"plt.xlabel('Wiek', fontsize=12)\n",
|
||
|
"plt.ylabel('Liczba miliarderów', fontsize=12)\n",
|
||
|
"\n",
|
||
|
"sns.set_style(\"whitegrid\")\n",
|
||
|
"sns.despine(left=True)\n",
|
||
|
"plt.grid(axis='y', linestyle='--', alpha=0.7)\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "5a2f18c9",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Pokazanie średniego wieku miliarderów w danym kraju i zestawienie ich ze średnią długościa życia w danym kraju.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 114,
|
||
|
"id": "6bbe5663",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA00AAAHcCAYAAAAKpkHjAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAACTRklEQVR4nOzdd1QUVxsG8GepihQFsSBWFFBBigVRrGjsPfausSuKJbZYgwW7Yu8lNhQ1dhNLosaOoGI3KKCoFBWkwzLfH35sXIFlwYVZ4PmdwznuzJ0779x3d913Z+auRBAEAURERERERJQhDbEDICIiIiIiUmcsmoiIiIiIiBRg0URERERERKQAiyYiIiIiIiIFWDQREREREREpwKKJiIiIiIhIARZNRERERERECrBoIiIiIiIiUoBFExERERERkQIsmoiowFm5ciWsra3x+++/ix0KUZ7w9fVFzZo14ebmhtTUVLHDISIqcFg0EVGBcvHiRWzatAnTpk1Dp06dxA4HAHDkyBFYWVnhyJEjeb7v/v37w8rKKs/3q6zXr1/DysoK06ZN+65+bt68CSsrK3h5eakosvwjIiICEyZMQJ06dbBs2TJoaIj3X7uVlRX69+//3f3k5fNWVTFnl6qe+0SUN7TEDoCI8r9vP9xoaGjA0NAQVlZW6N69Oz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0KN2N4GmX2H0trb+0y7++Vb9+ffj6+uLRo0eoW7eurO2RI0dw48YNWFtby32Qf/PmDXbu3ImYmBjo6+vjxo0
|
||
|
"text/plain": [
|
||
|
"<Figure size 1000x500 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"d= df[['country','age', 'life_expectancy_country']]\n",
|
||
|
"avg_age = d.groupby('country')[['age','life_expectancy_country']].mean().reset_index()\n",
|
||
|
"avg_age.columns = ['Country', 'Średni wiek miliarderów', 'Średnia długość życia w kraju']\n",
|
||
|
"countries = ['United States', 'India','China', 'France','United Kingdom'\n",
|
||
|
" 'Russia', 'Italy','Switzerland','Singapore','Germany']\n",
|
||
|
"top_countries_age = avg_age.loc[avg_age['Country'].isin(countries)]\n",
|
||
|
"top_countries_age.fillna(85.39)\n",
|
||
|
"\n",
|
||
|
"df_long = pd.melt(top_countries_age, id_vars='Country', var_name='Variable', value_name='Value')\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(10,5))\n",
|
||
|
"c_plot = sns.barplot(x='Country', y='Value', hue='Variable', data=df_long, palette='Set2')\n",
|
||
|
"\n",
|
||
|
"plt.title('Porównianie wieku ze średnią życia')\n",
|
||
|
"plt.xlabel('Kraj')\n",
|
||
|
"plt.ylabel('Wiek')\n",
|
||
|
"plt.legend(title='Legenda', loc='lower left')\n",
|
||
|
" \n",
|
||
|
"for p in c_plot.patches:\n",
|
||
|
" c_plot.annotate(f'{p.get_height():.0f}', (p.get_x() + p.get_width() / 2., p.get_height()),\n",
|
||
|
" ha='center', va='center', xytext=(0, 10), textcoords='offset points')\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "b8eed713",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Miejsce urodzenia\n",
|
||
|
"\n",
|
||
|
"**Wykres pokazujący w jakim mieście urodziło się najwięcej miliarderów**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 97,
|
||
|
"id": "383d14de",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABl0AAAJoCAYAAADs7Ce3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeVhUZf/H8c8Mi4IsCkJKiHvghuGSgktaZpmZlmm5pT6lLS6pLWZP5pJrq2Y+mJZrmVlqmuWaaZY7qWmpuWbuigsoKMvM7w9/TI6AwnhkBni/rqur5j5nZr7fm7thhs+cc0xWq9UqAAAAAAAAAAAA3BKzswsAAAAAAAAAAAAoCAhdAAAAAAAAAAAADEDoAgAAAAAAAAAAYABCFwAAAAAAAAAAAAMQugAAAAAAAAAAABiA0AUAAAAAAAAAAMAAhC4AAAAAAAAAAAAGcHd2AQAAAAAAwFjHjh3TvHnz5O/vry5dushkMjm7JAAAgEKB0AUAAAAAgAIkNTVV/fr1065duzR16lQCFwAAgDzE6cUAAABg57777lN4eLjdP9WrV1fjxo31wgsv6KeffnJabRs3blR4eLi6dOlyW+9zK+bPn6/w8HC9/vrrefJ8NzJhwgSFh4drwoQJzi6lUHj99dcVHh6u+fPnF8rnN0LGa871unTpovDwcG3cuNFu3BXXeHa15qV33nlHv//+u8aOHau6des6rQ4AAIDCiCNdAAAAkKVatWqpbNmykqTExETt2rVLq1at0qpVq9StWzcNGjTIyRXC1WX88XzPnj1OrgQoPJYvX66ZM2fqtdde08MPP+zscgAAAAodQhcAAABkqV27dnr88cdtt9PS0jR69Gh9/vnnmj59ulq2bKnIyEgnVoib6dSpkx5++GGVKFHC2aUgDwwYMEA9evRQcHCws0t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cvl5eWlRo0aSZKGDBmi48ePq3LlyqpVq5bc3d114MABLVmyRCtWrNAHH3ygBx980O4xLBaLXnrpJa1cuVIeHh6qV6+e/Pz8tH37drVr105t27a9ab3ZSU1N1TPPPKM///xT99xzj8qXL68tW7bo008/1f79+zVmzBg99dRTunDhgurWraty5cpp8+bN+vjjj3XmzBkNGzYsR88THx+v1157Tb6+vqpYsaLCw8OVnJysXbt2adasWfr+++81Z84cW8AmScnJyerYsaP++usvBQQEqH79+vL29tbp06d18OBB/e9//1P37t3l4eGhKlWq6LHHHtOCBQskSY899pjd83t7ezs8RzlltVrVu3dvrV27VnXq1FHFihW1d+9e2/Zx48YpNjZWJpNJUVFRCgkJ0f79+7VkyRItX75cw4cP1xNPPGH3mGfOnFGnTp106NAh+fv7q2nTprJYLPruu++0du1aVapUKVMdYWFhmfrPcPLkSa1bt06S5Obmlmn7vHnzFBsbq6pVq6pRo0Y6evSotm3bpoEDB+r8+fM5PqJh9+7dGjx4sAICAlS+fHlVq1ZNCQkJ2rlzpyZNmqQlS5boq6++cugUXatXr9bMmTN11113KSYmRgcPHtTmzZvVvXt3zZgxQ7t27dKIESNUs2ZNNWjQQLt27dK6devUuXNnffvtt3ZrzEiOrPFrLV26VHPmzFGFChUUExOjCxcuyNPTU5K0f/9+denSRfHx8QoKCtJ9992n5ORkTZ8+XRs3bsy2prS0NL3yyitasmSJPD09Va1aNd1xxx06dOiQvvvuO61YsUITJkxQ48aNM93X6PUcHR2tFStWaN26dWrevLlt/Pfff9fFixclSRs2bJDVarV7Ld2wYYMkKSYmJic/BgAAgEKJ0AUAAAA5tn//fv3zzz+SlOkIg48++kjr1q1TWFiYpk2bptDQUElXg4ShQ4fqm2++Ud++fW1/cJSknj17Zvk8a9as0XfffScvLy+9/PLLN6xpy5Yt6tWrlxITEzVs2DA99dRTWe63detWbdq0SZ07d7aFLgMHDlTdunXl7+9vt+/KlSv10ksv6a233tK9996rokWL2rZ9+eWXWrlypUqWLKmZM2faToeUlpamESNGaPbs2Tes90a2bt2qyMhIrVy50vYH8KNHj+qxxx7TTz/9pC5duqhcuXL68MMP5eXlJUnasWOHnnrqKc2dO1fPPfecQkJCbvo8Pj4++t///qdGjRrZfhbS1Z/VhAkT9Mknn2jkyJGaPHmybduyZcv0119/qXHjxvrf//4nDw8P2zaLxaItW7bY5qlZs2Zq1qyZLXQZM2aMw3PiqGPHjtkCkfLly9tt+/nnnxUbG6siRYooNjZWDRo0sG37+uuv9eabb2ro0KGqWbOmKleubNs2fPhwHTp0SHXq1NGkSZPk6+sr6erRLz179tSqVasy1VGnTh3VqVMn03hCQoI6duwoSfrPf/6j0qVLZ9pnypQpio2NVdOmTW1j8+fP16BBg/Txxx/rqaeeslub2QkNDdX06dNVr149uxAzOTlZQ4cO1bfffquPPvpIQ4YMueljXW/atGkaO3asWrdubRsbM2aMpk2bpjfeeEMnT57U1KlTFR0dLUlKT09X//79tWzZMk2ZMkUjRozI9XPmhCNr/FqzZ8/WW2+9pU6dOmXaNnDgQMXHx6tFixYaO3asihQpIunqmuvatasOHz6c5WNOmDBBS5YsUc2aNfX++++rTJkytm1Lly7VgAED9Morr2jlypXy8/Ozu6/R6zkjNFm/fr3dY2WEgOHh4dqzZ4/+/PNPW1B+8OBBHTt2TOXKlcvR6wwAAEBhxenFAAAAcFOJiYn65Zdf1Lt3b6Wnp+uFF15QjRo1bNuvXLmiL774QtLV089kBC6S5OHhoTfffFMlS5bUkSNHtGzZshs+1x9//KF+/frJarXqgw8+uOF1YxYvXqzu3bsrJSVFsbGxWQYuGd8GL1asmGJjYzV48GDbtmbNmmUKXDLGH3roIZ0/fz7TN9dnzJgh6er
|
||
|
"text/plain": [
|
||
|
"<Figure size 2000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"top_birth_cities = df['city'].value_counts().head(20)\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(20, 6))\n",
|
||
|
"sns.barplot(x=top_birth_cities.index, y=top_birth_cities, palette=colors)\n",
|
||
|
"plt.title('Rozkład miast urodznia miliarderów', fontsize=16)\n",
|
||
|
"plt.xlabel('Miasto urodzenia', fontsize=12)\n",
|
||
|
"plt.ylabel('Liczba miliarderów', fontsize=12)\n",
|
||
|
"plt.xticks(rotation=45, fontsize=10)\n",
|
||
|
"plt.yticks(fontsize=10)\n",
|
||
|
"plt.grid(axis='y', linestyle='--', alpha=0.7)\n",
|
||
|
"\n",
|
||
|
"for i, v in enumerate(top_birth_cities):\n",
|
||
|
" plt.text(i, v + 5, str(v), color='black', ha='center', va='bottom', fontsize=10)\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "624cbc10",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Pokazanie miesięcy i dni w których urodzili się miliarderzy.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 104,
|
||
|
"id": "90187716",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABScAAAIrCAYAAAAdqSwlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAADQT0lEQVR4nOzdeXxU1f3/8fedJRtZIBsQBJUlgAQIhN0IRVFcq4BWLVJtXeivIriDtBUsiFg33FqUqq2Iol9R3HctakE22UExILIEyAIJ2SeZub8/wkwyJIFkmMkk4fV8PPJI5txlPufMncm5nzn3XMM0TVMAAAAAAAAA0MgswQ4AAAAAAAAAwKmJ5CQAAAAAAACAoCA5CQAAAAAAACAoSE4CAAAAAAAACAqSkwAAAAAAAACCguQkAAAAAAAAgKAgOQkAAAAAAAAgKEhOAgAAAAAAAAgKW7ADAADgVLRw4ULl5eVp7Nix6tChQ7DDAQAAAHyydOlS7dmzR+eff7569OgR7HDQDDFyEgCARvbyyy9r9uzZys3NJTEJAACAZuuLL77Q1KlTtWXLFnXr1i3Y4aCZIjmJRnHuueeqe/fu6t69u2bPnn3cdf/1r3951j3rrLNqLJ8wYYK6d++ulStXBircOq1cuVLdu3fXhAkTGv25UcV9PO3duzfYodRbSzh2pk2bpu7du+utt97yKn/rrbfUvXt3TZs2zat879696t69u84999zGDPO46oq1MW3cuFF///vfNXLkSP31r38NWhwAAJxI9T589+7d1aNHD/Xr10/Dhw/XhAkT9PDDD2vjxo0Bee66+h0tTTDPbXzVFPt4DfX000+re/fuevrpp73Kj9dnd78PmoqmcH6xd+9eTZs2Tb1799YTTzwhq9UatFjQvHFZNxrde++9p3vvvVchISG1Ll+yZEkjRwQAjSM/P1+33367evToQQcOANBs9O/fX6effrokqbS0VIcPH9a2bdu0atUqvfjiixo0aJDmzJmjjh07BjlSAI3F4XBoypQpiomJ0XPPPafw8PBgh4RmjOQkGlVKSoo2b96sL774QhdddFGN5d9//7127typ3r17a9OmTbXu4+GHH1ZJSYmSkpICHW4Nffr00YcffsgHLxqsJRw7d955p26++WYlJibWa/22bdvqww8/lN1uD3Bkzce2bds0duxYXXvttc36WAAAnFquuuoqjR071qvMNE19/fXXmjNnjlatWqVrrrlGixcv9luCsqH9DjSeltDHGz9+vC6++GK1adOm3tt8+OGHAYyo+cnIyNCvfvUrXXrppYqLiwt2OGjmSE6iUY0bN06bN2/WkiVLak1Ovvnmm5716kpOBiMp6RYeHq4uXboE7fnRfLWEYycxMbFBJwh2u73Z19nfhgwZoiFDhgQ7DAAATpphGBoxYoT69eunq666Srt27dJf/vIX/ec///HL/hva70DjaQl9vNjYWMXGxjZom+ZeZ38766yzap2GDfAFc06iUSUnJyslJUX/+9//dPDgQa9lRUVF+uijj9SuXTulp6fXuY8TzcuyYsUKTZo0Senp6UpJSdHQoUN16623at26dbWuv2vXLt13330699xzlZKSon79+mnkyJG65ZZbalxifrx5PZYvX65Zs2bp8ssv1+DBg5WSkqLhw4fr9ttvP+FcPJs3b9bUqVN17rnnqnfv3ho0aJB+/etf6+GHH9a+fftqrH/w4EE99NBDuuiii9S3b1/169dP48aN0yuvvKKKiorjPtexTjSfT11z9FUvz8vL04MPPqhRo0YpJSXFq30qKir02muv6ZprrlFaWpp69+6tCy64QLNnz65xDFSXkZGhyZMna/DgwerTp48uvfRSvfDCC3I6ncetx/F+apsXJz8/X0899ZQuv/xy9evXT3379tVll12mf/zjHyopKamxfvX5aQ4dOqQHHnhAI0aMUEpKikaMGKFZs2bpyJEjNbYL1LFTm+qvTUFBgR566CHPsXXBBRfo+eefl8vlklR5LN1///2eOowePVoLFy6sdb8NnfvpePMRueddvPLKK3X22WcrJSVFw4YN0x//+EctX778hPU60TH373//W5dddpl69+6tIUOG6LbbbtOPP/54wph//vln3X///Ro1apR69+6ttLQ0jR8/Xu+8806t61f/PFqzZo3++Mc/asiQIerRo4dXOx04cECzZs3SBRdc4Nmve4TJscf0F198oe7du+uPf/xjjeebOXOmunfvrl69eqmwsNBr2erVq9W9e3eNHz/+hPUEAMBfoqOjNX36dEnSd999p82bN3strz5X+Hfffac//OEPGjhwoPr06aMxY8Zo6dKlte7Xlzkn65pH0K2u/lj18pKSEj355JOefvax/ZgPPvhA119/vQYNGqSUlBSNHDlS9913n37++ec649q/f7/uu+8+paene/pjTzzxhEpLS49bjxP9HKu0tFQvvviifvOb32jAgAHq3bu3Ro8erb///e86fPhwjfWr962Ki4v12GOP6fzzz1dKSorOPvtsTZ06tdb+ur/7eMdT/bVxOBx65plnNHr0aPXu3Vu/+tWv9Mgjj6isrEySVFBQoIcffljnnXeeevfurXPPPVdPP/10redHJzpWalNXu2dkZOipp57SNddco3POOUcpKSkaPHiwbrjhhjpHWzbkmFu6dKnGjRunvn37atCgQbrxxhu1Zs2aE8bb0HPG6u+57du36/bbb1d6erp69uzp1U55eXl6/PHHdckll3j2O3bsWC1YsKDGMf3DDz+oe/fuuuyyy2o834IFCzxtmpGR4bUsMzNT3bt3169+9asT1hMtAyMn0ejcoyffeust/b//9/885R999JGKi4v1u9/9ToZh+LTvhx9+WC+++KIsFotSUlKUlpam/fv364svvtBXX32lWbNmady4cZ71t2/frmuvvVaFhYU688wzNXLkSFksFh08eFCrV6/WwYMHvdY/nhkzZmj//v3q1q2b+vfvL5vNpp07d+qjjz7SZ599pscff1yjR4+usd2//vUvPfbYY3K5XDrjjDN03nnnqbS0VLt379aLL76obt26eV1Gs3r1at16663Kz89Xhw4dNGzYMDkcDm3atEmzZs3SV199pfnz5zfaZRaHDx/WuHHjVFBQoLS0NPXq1cvz3A6HQxMnTtTy5csVGhqqwYMHKzIyUuvWrdPChQv1/vvv64UXXlCvXr289rlmzRrdfPPNKi4uVseOHXX22Wfr8OHDeuKJJ7Rhw4Za40hLS6szxi1btmj79u2yWLy/j8nIyNBNN92k/fv3KyEhQWlpabLZbNq0aZOefPJJffrpp1q4cKGioqJq7HP//v0aM2aMKioq1L9/f5WVlen777/XK6+8og0bNui1116r92vg67FzIkeOHNHVV1+tvLw8DRgwQEVFRVqzZo0ee+wxHTx4UNdff71++9vfymazqV+/fjp06JDWrFmj2bNnq6SkRLfcckuDn7O+Hn/8ca1cuVJdu3ZVr169FB4erj179uirr77SV199penTp+v666+vddvjHXMul0tTpkzR559/LrvdrsGDBys6OlobNmzQVVddddz380cffaSpU6eqrKxMnTt31ogRI1RQUKCNGzfq3nvv1XfffaeHHnqo1m0//vhjLV68WJ07d9awYcOUn5/vmVd348aNuvnmm5WXl6ekpCSNGjVKBQUFWrVqldatW6fPPvtM//znPz3rDx48WDabTatXr1ZFRYVstqp/1StWrJBUmYBduXKlzjvvPM8yd4d/6NCh9X0ZAADwi+HDh6t169bKy8vT8uXLlZKSUmOdJUuW6J///KfOOussnXPOOdq3b5/Wr1+vqVOnKi8vTzfccEPjB36MsrIyTZgwQTt27NCAAQPUo0cP5eXlSaq8jH3atGlaunSpbDabBgwYoLi4OG3ZskVvvfWWPvroIz311FMaPny41z537NihCRMmKDc3VwkJCTr33HNVUlKif//733UOtujZs6fGjBlT67Kff/5Z69evr9GvPXjwoG666SZt375drVu3Vu/evdWqVStt3bpVL7zwgj7++GMtXLhQHTp0qLHPgoI
|
||
|
"text/plain": [
|
||
|
"<Figure size 1600x600 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))\n",
|
||
|
"# Plot the birth month distribution\n",
|
||
|
"ax1.set_title('Miesiące urodzenia miliarderów', fontsize=16)\n",
|
||
|
"sns.histplot(data=df['birthMonth'], bins=12, color='skyblue', kde=True, ax=ax1)\n",
|
||
|
"ax1.set_xlabel('Miesiąc urodzenia', fontsize=12)\n",
|
||
|
"ax1.set_ylabel('Liczba miliarderów', fontsize=12)\n",
|
||
|
"\n",
|
||
|
"# Plot the birth day distribution\n",
|
||
|
"ax2.set_title('Dni urodzenia miliarderów', fontsize=16)\n",
|
||
|
"sns.histplot(data=df['birthDay'], bins=31, color='skyblue', kde=True, ax=ax2)\n",
|
||
|
"ax2.set_xlabel('Dzień urodzenia', fontsize=12)\n",
|
||
|
"ax2.set_ylabel('Liczba miliarderów', fontsize=12)\n",
|
||
|
"\n",
|
||
|
"# Set the style and remove the left despine\n",
|
||
|
"sns.set_style(\"whitegrid\")\n",
|
||
|
"sns.despine(left=True)\n",
|
||
|
"plt.grid(axis='y', linestyle='--', alpha=0.7)\n",
|
||
|
"\n",
|
||
|
"# Adjust the spacing between subplots\n",
|
||
|
"plt.subplots_adjust(wspace=0.4)\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "d6f6d8ee",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Płeć\n",
|
||
|
"\n",
|
||
|
"**Wykres kołowy przedstawiający procentowy rozkład płci wsród miliarderów.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 115,
|
||
|
"id": "1672bf77",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAccAAAGFCAYAAACIbDjVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABTX0lEQVR4nO3dd3hTZcMG8Ds76aaDbsps2bssWWXPsoeAioCiIsgQZIMo8CICIsMXByJ7771HEUH2akuBMsvooivNPt8faL83BZSR9iTt/buuXtU8ycmdKtx9nrMkgiAIICIiohxSsQMQERHZG5YjERFRLixHIiKiXFiOREREubAciYiIcmE5EhER5cJyJCIiyoXlSERElAvLkYiIKBeWIxERUS4sRyIiolxYjkRERLmwHImIiHJhORIREeXCciQiIsqF5UhERJQLy5GIiCgXliMREVEuLEciIqJcWI5ERES5sByJiIhyYTkSERHlwnIkIiLKheVIRESUC8uRiIgoF5YjERFRLixHIiKiXFiOREREubAciYiIcmE5EhER5cJyJCIiyoXlSERElAvLkYiIKBeWIxERUS4sRyIiolxYjkRERLmwHImIiHJhORIREeXCciQiIsqF5UhERJQLy5GIiCgXliMREVEuLEciIqJcWI5ERES5yMUOQFQYmUwmpKenIz09HWlpaTn/nJ6eDkEQoFaroVKpXuq7UqmERCIR+yMRFSgsRyIbSUtLQ3x8vNVXQkICnqSlIzU1LacIMzPTocvW2ux9pVIpivoGoFixYJQoXgzBwcEoVuz/vxcrVgxeXl4sUKJXIBEEQRA7BJGjMBgMuHHjBqKjoxETE4OYmBhcuhyNmzdvID0tNed5coUGGo/ikGkCIFV6QK50h0zpCpnSDTKV29Pvfz2WM6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"display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"d = df['gender']\n",
|
||
|
"d =d.map({'M': 'Mężczyźni', 'F': 'Kobiety'})\n",
|
||
|
"val = d.value_counts().values \n",
|
||
|
"keys = d.value_counts().index\n",
|
||
|
"colors = sns.color_palette('rainbow')\n",
|
||
|
"ax = plt.pie(val, labels=keys, autopct='%.0f%%', explode = [0, 0.1], colors = colors,\n",
|
||
|
" wedgeprops = {\"edgecolor\" : \"black\", \n",
|
||
|
" 'linewidth': 1, }) \n",
|
||
|
"plt.show() "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "446caae7",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Najbardziej majętne osoby"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 121,
|
||
|
"id": "6ac7ddbe",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0UAAAHMCAYAAAAapwOMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1yV5f/48deBw0ZA9pLhQMSF4so90zRT03Di1nKVOdNSUcOZOXIU7oE5ysxcZSpo7vLjFnOkJlNUQFDGgfP7wx/31xMoICKC7+fj4ePhua7rvu7ruuEczvu+xq3SarVahBBCCCGEEOINpVfUDRBCCCGEEEKIoiRBkRBCCCGEEOKNJkGREEIIIYQQ4o0mQZEQQgghhBDijSZBkRBCCCGEEOKNJkGREEIIIYQQ4o0mQZEQQgghhBDijSZBkRBCCCGEEOKNJkGREEIIIYQQ4o0mQZEQQgiRg4CAACpWrKiTduLECSpWrMg333xTRK3KXfPmzWnevHmRHZ+lYsWKBAQEFLieV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du3XK9BkI8jwRFQgghiq0aNWrQunVrfv31V3bv3k3btm1zLPfvv//SpUsXEhMTqVWrFg0bNsTc3Bx9fX0iIiL46aef8rVA29bW9rnpSUlJStratWuZMWMGlpaW1K9fHycnJ0xMTJQ1F+Hh4Tme+1nnyNpMwcbGJlueWq2mdOnSz2z39evXGTFiBCYmJgQHB+dYx38lJiai1Wq5f/8
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ax = sns.barplot(df.head(20), x='finalWorth',y='personName', hue = 'personName', legend = False,orient='h', palette='rainbow')\n",
|
||
|
"ax.set_title('Najbardziej majętne osoby')\n",
|
||
|
"ax.set_xlabel('Osoba')\n",
|
||
|
"ax.set_ylabel('Majątek')\n",
|
||
|
"for container in ax.containers:\n",
|
||
|
" ax.bar_label(container, fontsize=8)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9cc149f8",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Najpopularniejsze imiona wśród miliarderów"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 133,
|
||
|
"id": "485226f0",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABlQAAAJXCAYAAADl1bkFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAADZb0lEQVR4nOzdd3xT9f7H8XdWS3eLZYqACAVkiSC4QVxX1J9XHKCgOBAUHKgocsGBDCeiV1G5ICqKKOoFUUFRQQUZFVFEyhCQvVronmmS3x/cxJYWThNCc0pez8fjPq79nCT9fL6c9CR99+RYPB6PRwAAAAAAAAAAADgia6gbAAAAAAAAAAAAMDsCFQAAAAAAAAAAAAMEKgAAAAAAAAAAAAYIVAAAAAAAAAAAAAwQqAAAAAAAAAAAABggUAEAAAAAAAAAADBAoAIAAAAAAAAAAGDAHuoGAAAAAAA43ubMmaMdO3bo0ksvVatWrULdDgAAAGogzlABAAAAAJzQvvvuOw0fPlxr165VixYtQt0OAAAAaigCFQAAANRYPXr0UMuWLcv9r23btrrwwgt1zz33aNGiRSHrbcWKFWrZsqVuueWW43qfY/Hf//5XLVu21GOPPVbl++zcuVMtW7ZUjx49jmNnf6vuNTGTV199VS1bttSrr75arn60NfE+D8zCDP9+O3fu1GOPPaZ27dpp4sSJstlsIesFAAAANRsf+QUAAIAa78wzz1STJk0kSbm5uVq3bp0WLlyohQsX6rbbbtOIESNC3CGAUCgpKdEDDzyghIQETZ48WVFRUaFuCQAAADUYgQoAAABqvBtuuEG9evXyfV1aWqpnnnlG77//vt555x1deeWVat++fQg7PHHUq1dP8+bNk8PhqJbv1759e82bNy8sfxHet29f9ezZU0lJSVW+z7x5845jRzXPpk2b1L17d1111VU66aSTQt0OAAAAajgCFQAAAJxw7Ha7Hn30Uc2ZM0d5eXlatGgRgUqQOBwOnXbaadX2/aKioqr1+5lJ7dq1Vbt2bb/uE65rdSSnn366Tj/99FC3AQAAgBME11ABAADACSkyMtL3MWAHDhyosL20tFQzZ85Unz591KlTJ7Vr106XXXaZxo4dq3379lW4/S233FLhei2H/6+q14k4ePCg+vTpo5YtW2ro0KEqKSkxvM/SpUs1ZswYXXPNNeratavvWjFDhw7V77//fsT7lZaW6p133tHVV1+tdu3a6eyzz9Z9992nDRs2VKnXwx3tGiplr9/x2Wef6frrr1fHjh119tln66GHHtLu3bslSR6PR++//76uueYanXHGGeratasee+yxSv+djK7BsXnzZo0YMUIXXXSR2rZtqy5duqh///5HPFOj7HVJDh48qNGjR6tbt25q27atunXrpjFjxignJ8evNSnbY0lJiV577TVdfvnlateunbp3764XXnhBxcXFkg59JN1zzz2niy++WO3atVOPHj306quvqrS09Ki9VtWRrqGyadMm/fvf/1afPn10wQUXqG3bturatatuu+22I65V2bkKCwv1yiuv6IorrlCHDh0q/PvPmTNH1113nTp06KAuXbrozjvv1MqVKw373bdvn5555hnf43bs2FHXXXed3n///UrX5LHHHlPLli313//+Vxs3btTQoUN1/vnnq3Xr1uXWKSsrSy+99JKuvPJK3+P26tVLU6ZMUVFRUbnHXL9+vVq2bKmrr766wvebMmWKb003bdpUbtvu3bvVsmVLde/e3XBOAAAAnBg4QwUAAAAnrPz8fEmq8FE/JSUlGjRokJYuXarIyEh17dpVsbGx+vXXX/Xee+/piy++0FtvvaU2bdr47nPBBRfo5JNPrvT7pKamateuXbJajf9e6a+//tLAgQO1fft2DRgwQMOGDZPFYqlwuwULFigqKkoXXHCBJOnJJ5/Unj171KJFC5155pmy2+3asmWL5s+fr2+++UYvvfSSLr/88nKP4Xa79cADD+jbb7+Vw+FQ165dFR8fr9WrV+uGG27QddddZ9hvICZMmKBp06apc+fOuuCCC7RmzRp9+eWXWrVqlT777DM9+eSTWrhwobp06aJTTjlFq1at0uzZs5WWlqZPPvlEERERVfo+33//ve6//34VFxfr1FNP1WWXXaYDBw7o559/1vLly7VkyRKNHz++0vvu2bNH1157rUpLS3XmmWequLhYq1at0vvvv6/Vq1dr5syZfn+smdPp1J133qm0tDR16dJFp556qlauXKmpU6dq8+bNevbZZ9WnTx9lZ2frrLPOUtOmTfXzzz/rtddeU0ZGhkaPHu3X9/PH22+/rU8++UTNmjVTSkqK4uPjtWfPHq1YsULLli3T6tWrj3itoeLiYt1yyy3avHmzOnfurFatWikrK8u3fezYsXrvvfdktVrVqVMn1a1bVxs2bNAtt9yifv36HbGnn3/+WUOGDFF2drZOPvlknXvuuSopKdGaNWs0ZswYLVq0SG+++Wal/w6//vqrnnzySdWpU0edO3dWUVGRYmJiJEk7duxQ//79tWvXLtWuXVvdunWT0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xYkSFX44Hy/333+8LUySpVq1auv322yVJGzdu1KhRo8qd7VO7dm3ddNNNksqfEXA0s2bNUm5urtq0aaN77rmn3Fk+7dq109133y1Jeuuttyq9f/369fXEE0+UOxumQYMGvjMqvGcf+MNisWjcuHHlLiJ/8skn+wKinTt3aty4cb4wxdvrBRdcILfbrdTUVL+/Z1V5zwY6XLNmzTR48GBJ0ldffXXE+z/xxBOV7i/efaxv377lwhRJGjRokFq3bl3p47377rvKyspS3759dfPNN5cLRZKSkvT888/L4XBoxowZ8ng8Fe7ftGlTDR06tEKYsnLlSq1evVpRUVEaM2aML0yRDu1nTz/9tCRp3rx52rt3r2+b9yyTsv/uv/zyi4qKinT55ZerTZs2Sk1
|
||
|
"text/plain": [
|
||
|
"<Figure size 2000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"names = df['firstName'].value_counts().head(20)\n",
|
||
|
"\n",
|
||
|
"# plot this\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(20, 6))\n",
|
||
|
"sns.barplot(x=names.index, y=names, palette=colors)\n",
|
||
|
"plt.title('Rozkład imion miliarderów', fontsize=16)\n",
|
||
|
"plt.xlabel('Imię', fontsize=12)\n",
|
||
|
"plt.ylabel('Liczba miliarderów', fontsize=12)\n",
|
||
|
"plt.xticks(rotation=45, fontsize=10)\n",
|
||
|
"plt.yticks(fontsize=10)\n",
|
||
|
"plt.grid(axis='y', linestyle='--', alpha=0.7)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "51c15b35",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Wykres pokazuję czy miliarder dorobił się sam czy odziedziczył fortune"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 134,
|
||
|
"id": "cf4ddf95",
|
||
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q1Ss4ODiorXfnzh34+fmhdevWBXKp+JdffsGtW7fQtm1blChRApcvX8aOHTtw69Yt7NmzB3p6el+tIzw8HD169EBgYCBq166N2rVrIzQ0FD///HOa45nKgwcPMHDgQMTFxcHd3R0VK1bEy5cvcfToUZw/fx7btm1D9erVAXz6Tg0ZMgR3795FrVq10LVrV0ilUrx//x4+Pj6oU6eOmNz069cPXl5eqFKlClq2bCm+XtWqVQF8+pHr4eGBWrVqoVGjRihVqhRCQ0Ph7e2NYcOGYdGiRejatWu6bc7LzzQlJQWDBg1CZGQkWrRogZSUFBw/fhxjx47F1q1bsXv3bty/fx9NmzaFrq4uTp06hYULF6JUqVJq38ucxJfaixcvsHz5ctSsWROtWrWCvr4+Xr9+DW9vb1y6dAnr169H06ZNxfd2zJgxWLt2LaysrNC5c2exnnr16on/PnDgAObOnQtdXV24u7ujXLlyePPmDf766y/8+++/2L9//1eHnRw9ehQzZ86EjY2NeJXvSxo2bIh//vkH165dg729vViummHi7t27SEpKEr/nN2/ehFwuz9TNiFk516hkZX/btGkTXr16hVq1asHNzQ3Jycm4c+cO1qxZAx8fH2zfvl08fwLZ2w/Tk9X3OEeELOjXr58gk8mEffv2fXXdiRMnCjKZTPD09BQEQRCio6OFypUrC507dxbkcnma9cPDw8V/v337VnBychJq1aol+Pv7q633888/CzKZTJg9e7ZaeZ8+fQSZTCa0atVKiIyMFMsTExOFbt26CTKZTDh8+LBY/uDBA0Emkwljx45N05bVq1d
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"self_made_by_age = df[['age','selfMade']]\n",
|
||
|
"bins = [15, 25, 35, 45, 55, 65, 75, 85, 95, 105]\n",
|
||
|
"self_made_by_age['age'] = pd.cut(self_made_by_age['age'], bins = bins)\n",
|
||
|
"ax = sns.countplot(self_made_by_age, x = self_made_by_age['age'], hue = self_made_by_age['selfMade'], palette= 'flare' )\n",
|
||
|
"ax.tick_params(axis='x', rotation=45)\n",
|
||
|
"ax.set_title('Osoby, które same się dorobiły lub dostały majątek w spadku')\n",
|
||
|
"ax.set_ylabel('Liczba osób')\n",
|
||
|
"ax.set_xlabel('Wiek')\n",
|
||
|
"for i in ax.containers:\n",
|
||
|
" ax.bar_label(i)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "1dc97d26",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Pokazanie ile miliarderów ma jaki majątek"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"id": "d3dcf5fa-8dba-494d-8681-81dd116dc6ca",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkgAAAHNCAYAAADli4RZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAABeJ0lEQVR4nO3deXhMZ/8/8PckM9llk0QSZLHEGpGqpfhKxFqlbaqkQilF1VKtLmKprfZWSy0PJWqpWh+qloiilKJaGiSWIEIskUQyISLLJPfvD785T+ZMIhGTZeT9ui4Xc8499/mc3CfJ2zn3OaMQQggQERERkcSkogsgIiIiqmwYkIiIiIhkGJCIiIiIZBiQiIiIiGQYkIiIiIhkGJCIiIiIZBiQiIiIiGQYkIiIiIhkGJCIiIiIZBiQiIiIylFeXh46duwIR0dHREdHV3Q5VAQGJKJysmbNGigUCqxZs6aiS5F4eXnBy8urzPp/7733oFAoEB8fX2bboMqjsOOpqOO+rI+9kggMDIRCoSj37Y4fPx5//fUXdu3ahaZNm5b79qlkGJCoXCgUCp0/5ubmcHZ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KHTp0eOr+UCkIonIAQBR3uB04cEAAEC4uLiI/P18IIcTatWsFADFx4sRC3+Pj4yPMzc1FcnKyEEKIs2fPCgsLC2FpaSlCQkJEWFiYGDlypOjatatQqVTi4cOHQgghvvvuOxEQECAAiEGDBompU6dKf7QGDRokAIiePXsKOzs7ERoaKsaPHy8mTpwo8vPzRd26dYWVlZVQq9V6dW3YsEEAEJ9++qm07McffxQARK9evYRSqRR9+vQREyZMEK+++qoAIBwdHcWlS5d0+tHWWBhtfz/++KPO8r///ls4OjoKAKJDhw7iiy++EKNHjxZBQUHCxMREp62np6fw9PTUWXbixAmhUqlEp06dxPDhw8X48eNFv379hLW1tVAqlSIiIqLQegqj/Rq+/vrrwt7eXgwfPlx88cUXws/PTwAQLVq0EI8fP9Z5z65du4SZmZlQqVSiX79+IiwsTHTp0kUAEO7u7iIuLk6n/cWLF4WDg4MAIF577TUxYcIEERISIlQqlXjjjTcK/Rp169ZNeHp6in79+onPPvtMjB49Wvj7+wsAIjAwUGg0Gp322dnZUg21a9cWI0aMEF988YXo27evcHR0lPov7rj67bffBAAxfvx4nf7btWsnfY9cv35dWn7+/HkBQLz33nvSsrt37woTExPRvn178f7774uwsDAxaNAgacxXrlxZ4vGZOnWqACDeeustYWlpKfr16yfGjRsnmjZtKu3D9u3bhZmZmQgODhaffvqpeOWVVwQA0b17d73+CjueijpODXXsARC+vr7C09NTNGnSRIwePVp89NFHYu/evUIIIb799lsBQO/48/T0FM2aNSv0+2vatGnS9+TAgQPFZ599Jrp27SoAiMaNG4v09HS9fXFzcxMtWrQQ3t7eYtiwYeLTTz8Va9asEUIIsXz5cqFQKISNjY0YPHiwGD9+vGjdurXUX1pamtTXypUrBQDxn//8R2cbNWvWFACEhYWFzvfMrl27BAAxbdo0vf2g58OAROWiJAEpKytLKJVKAUD6Jfj48WNRvXp14erqKnJzc3Xa//777wKACA0NlZaNGzdOABC//PKLXv+pqakiLy9Peq395fD7778XWo/2l3thv5SFEOLrr78WAMTixYv11ml/SV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AdObdfPjhh1AoFFixYoW0LCUlBTt27ECjRo10rr2HhITA1NQUb775JgYOHIh169bh2rVrz1VTq1atCl1evXp19O3bF9HR0Th+/Li0/IcffgAAjBgxotD3BQQE6C0zNTVF+/btAQD//vtvqWs9efIkAODVV18tdR8
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ax = sns.histplot(df,x='finalWorth',bins = 20)\n",
|
||
|
"ax.set_title('Dystrybucja bogactwa miliarderów')\n",
|
||
|
"ax.set_xlabel('Majątek')\n",
|
||
|
"ax.set_ylabel('Liczba osób')\n",
|
||
|
"labels = [str(v) if v else '' for v in ax.containers[0].datavalues]\n",
|
||
|
"ax.bar_label(ax.containers[0], labels=labels)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "65f27c98",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Zależnośc pomiędzy PKB a liczbą miliarderów"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 64,
|
||
|
"id": "071523c3-a6d2-40ca-9e22-05cc66193bb3",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAj8AAAHNCAYAAADxHhq4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAABsjUlEQVR4nO3deVhUVeMH8O+dhVlAFgUERVlE3Bc0s9RCsdxbLFNTe03Tcqkss7S0xdLUStOyxV9qablm2ptb7ruW+76QormBgDIg2zDL+f1h3NeJAWEYYGC+n+fheZh7zz33XM4sX+4994wkhBAgIiIichOK8m4AERERUVli+CEiIiK3wvBDREREboXhh4iIiNwKww8RERG5FYYfIiIicisMP0RERORWGH6IiIjIrTD8EBERkVth+KEK6a+//oKPjw/atWuH7OzsQsumpqYiIiICUVFRSE5OLqMWEhFVLhs3boRSqcSLL75Y3k0pMYafSubSpUuQJAnPP/+80+ps3749JElyWn0llZWVhaeffhq1a9fG6tWrodPpCiwrhMCAAQOQk5ODDRs2ICAgoAxbWnZ++OEHSJKEH374odT2sX37dkiShA8++KDU9kFFI0kS2rdvb7Psgw8+gCRJ2L59e6nvvyz3VdoKeu2EhYUhLCysSGXLUnm9Dv/++2/069cPTzzxBL755psy3XdpYPgpI2FhYZAkqUg/zgwuldGwYcNw+/ZtbNiwAX5+foWWnThxIvbs2YP169cjPDy8jFpIpe3fryeFQgFfX1+0adMGX331Fcxms93yly5dyldXcnIyWrVqBUmSMHDgQHnbvNB/949KpUL16tXRvXt3rF+/viwOlajcGY1G9OrVC40bN8bixYuhVCrLu0klpirvBriL1157DQaDocD1WVlZmDFjBiwWCxo3blx2DSuChQsXIisrq7ybAQC4du0aIiIi8O6776JGjRqFls3IyIBCocD69evRrFmzMmph+ejZsyceeOABBAcHl3dTytSoUaPg6+sLi8WCixcv4pdffsG+ffuwZcsWrFy58p7bX7x4EZ06dcL58+fx1ltvYerUqfnOcg4cOFA+A5CdnY1z585h7dq1WLduHebMmeMylwBefvll9O3bF7Vr1y7vplQoxXntuOvr7Pjx43j88cfx6quvQqvVlndznENQubNaraJXr14CgOjVq5ewWq0O13Xx4kUBQAwcONB5DSQSQmzbtk0AEO+//355N0WEhoYKAOLixYs2y0+ePCl0Op0AILZv315o+SNHjoigoCAhSZL4/PPP8+0jJiZGABDbtm3Lt27FihUCgAgNDXXOARUTABETE1Mu+xZCiPfff7/Av01lERoaWm79WxhXeh1WZLzs5QLee+89rFixAtHR0ViwYIHNf57Xr1/Hhx9+iLZt2yIoKAgeHh6oUaMG+vXrh9OnTxdrP1lZWZg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ZWRkiKysLPnxnDlzBADRqlUrYTAYbMqazWZx/fr1Qo8xDwABQDzzzDPCYrHIy+Pj44Wfn59Qq9XiwoUL8vLFixcLACI6Olrcvn3bpn0tW7YUAMSiRYvs7uOll16y2cfChQsFAOHn5yd69Ohh87feuXOnACCefPJJm7q+//57AUB8//338jKTySTq1KkjAIiffvrJpvzx48eFp6enaNiwoc1l1qFDhwoA4rXXXrMpf+DAAaFSqYp0uj0tLU00adJEKBQK8csvv8jLP/30UwFAfPnll/m2yXsOnTt3rtC68xTlstfOnTvzlX/zzTeFQqEQgYGB4uDBg4XuI69NAwcOFO+//754//33xdixY0XPnj2FWq0WDRs2FKdOnSpSe4W
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"df2 = df[['gdp_country','rank']].copy()\n",
|
||
|
"df2['gdp_country'] = df2['gdp_country'].astype(str).str.replace('[\\$,]', '', regex=True)\n",
|
||
|
"df2['gdp_country'] = pd.to_numeric(df2['gdp_country'], errors='coerce')\n",
|
||
|
"df2['gdp_country'].fillna(df2['gdp_country'].mean(), inplace=True)\n",
|
||
|
"\n",
|
||
|
"billionaires_based_on_gdp = df2.groupby('gdp_country')['rank'].count().reset_index()\n",
|
||
|
"\n",
|
||
|
"ax = sns.scatterplot(billionaires_based_on_gdp, x='gdp_country', y='rank', size='rank',sizes = (10,200), legend=False)\n",
|
||
|
"ax.set_title('Zależność pomiędzy PKB a liczbą miliarderów')\n",
|
||
|
"ax.set_xlabel('PKB')\n",
|
||
|
"ax.set_ylabel('Liczba miliarderów')\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3 (ipykernel)",
|
||
|
"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.11.8"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|