351 lines
163 KiB
Plaintext
351 lines
163 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(['work_year', 'experience_level', 'employment_type', 'job_title',\n",
|
||
|
" 'salary', 'salary_currency', 'salary_in_usd', 'employee_residence',\n",
|
||
|
" 'remote_ratio', 'company_location', 'company_size'],\n",
|
||
|
" dtype='object')\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"import pandas as pd\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"\n",
|
||
|
"df = pd.read_csv(\".//static//csv//ds_salaries.csv\")\n",
|
||
|
"print(df.columns)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Посмотрим краткое содержание датасета. Видим, что датасет состоит из 3755 строк и 11 столбцов"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"<class 'pandas.core.frame.DataFrame'>\n",
|
||
|
"RangeIndex: 3755 entries, 0 to 3754\n",
|
||
|
"Data columns (total 11 columns):\n",
|
||
|
" # Column Non-Null Count Dtype \n",
|
||
|
"--- ------ -------------- ----- \n",
|
||
|
" 0 work_year 3755 non-null int64 \n",
|
||
|
" 1 experience_level 3755 non-null object\n",
|
||
|
" 2 employment_type 3755 non-null object\n",
|
||
|
" 3 job_title 3755 non-null object\n",
|
||
|
" 4 salary 3755 non-null int64 \n",
|
||
|
" 5 salary_currency 3755 non-null object\n",
|
||
|
" 6 salary_in_usd 3755 non-null int64 \n",
|
||
|
" 7 employee_residence 3755 non-null object\n",
|
||
|
" 8 remote_ratio 3755 non-null int64 \n",
|
||
|
" 9 company_location 3755 non-null object\n",
|
||
|
" 10 company_size 3755 non-null object\n",
|
||
|
"dtypes: int64(4), object(7)\n",
|
||
|
"memory usage: 322.8+ KB\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
"<style scoped>\n",
|
||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe tbody tr th {\n",
|
||
|
" vertical-align: top;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe thead th {\n",
|
||
|
" text-align: right;\n",
|
||
|
" }\n",
|
||
|
"</style>\n",
|
||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||
|
" <thead>\n",
|
||
|
" <tr style=\"text-align: right;\">\n",
|
||
|
" <th></th>\n",
|
||
|
" <th>work_year</th>\n",
|
||
|
" <th>experience_level</th>\n",
|
||
|
" <th>employment_type</th>\n",
|
||
|
" <th>job_title</th>\n",
|
||
|
" <th>salary</th>\n",
|
||
|
" <th>salary_currency</th>\n",
|
||
|
" <th>salary_in_usd</th>\n",
|
||
|
" <th>employee_residence</th>\n",
|
||
|
" <th>remote_ratio</th>\n",
|
||
|
" <th>company_location</th>\n",
|
||
|
" <th>company_size</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>2023</td>\n",
|
||
|
" <td>SE</td>\n",
|
||
|
" <td>FT</td>\n",
|
||
|
" <td>Principal Data Scientist</td>\n",
|
||
|
" <td>80000</td>\n",
|
||
|
" <td>EUR</td>\n",
|
||
|
" <td>85847</td>\n",
|
||
|
" <td>ES</td>\n",
|
||
|
" <td>100</td>\n",
|
||
|
" <td>ES</td>\n",
|
||
|
" <td>L</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>2023</td>\n",
|
||
|
" <td>MI</td>\n",
|
||
|
" <td>CT</td>\n",
|
||
|
" <td>ML Engineer</td>\n",
|
||
|
" <td>30000</td>\n",
|
||
|
" <td>USD</td>\n",
|
||
|
" <td>30000</td>\n",
|
||
|
" <td>US</td>\n",
|
||
|
" <td>100</td>\n",
|
||
|
" <td>US</td>\n",
|
||
|
" <td>S</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>2023</td>\n",
|
||
|
" <td>MI</td>\n",
|
||
|
" <td>CT</td>\n",
|
||
|
" <td>ML Engineer</td>\n",
|
||
|
" <td>25500</td>\n",
|
||
|
" <td>USD</td>\n",
|
||
|
" <td>25500</td>\n",
|
||
|
" <td>US</td>\n",
|
||
|
" <td>100</td>\n",
|
||
|
" <td>US</td>\n",
|
||
|
" <td>S</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>2023</td>\n",
|
||
|
" <td>SE</td>\n",
|
||
|
" <td>FT</td>\n",
|
||
|
" <td>Data Scientist</td>\n",
|
||
|
" <td>175000</td>\n",
|
||
|
" <td>USD</td>\n",
|
||
|
" <td>175000</td>\n",
|
||
|
" <td>CA</td>\n",
|
||
|
" <td>100</td>\n",
|
||
|
" <td>CA</td>\n",
|
||
|
" <td>M</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>2023</td>\n",
|
||
|
" <td>SE</td>\n",
|
||
|
" <td>FT</td>\n",
|
||
|
" <td>Data Scientist</td>\n",
|
||
|
" <td>120000</td>\n",
|
||
|
" <td>USD</td>\n",
|
||
|
" <td>120000</td>\n",
|
||
|
" <td>CA</td>\n",
|
||
|
" <td>100</td>\n",
|
||
|
" <td>CA</td>\n",
|
||
|
" <td>M</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" work_year experience_level employment_type job_title \\\n",
|
||
|
"0 2023 SE FT Principal Data Scientist \n",
|
||
|
"1 2023 MI CT ML Engineer \n",
|
||
|
"2 2023 MI CT ML Engineer \n",
|
||
|
"3 2023 SE FT Data Scientist \n",
|
||
|
"4 2023 SE FT Data Scientist \n",
|
||
|
"\n",
|
||
|
" salary salary_currency salary_in_usd employee_residence remote_ratio \\\n",
|
||
|
"0 80000 EUR 85847 ES 100 \n",
|
||
|
"1 30000 USD 30000 US 100 \n",
|
||
|
"2 25500 USD 25500 US 100 \n",
|
||
|
"3 175000 USD 175000 CA 100 \n",
|
||
|
"4 120000 USD 120000 CA 100 \n",
|
||
|
"\n",
|
||
|
" company_location company_size \n",
|
||
|
"0 ES L \n",
|
||
|
"1 US S \n",
|
||
|
"2 US S \n",
|
||
|
"3 CA M \n",
|
||
|
"4 CA M "
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"df.info()\n",
|
||
|
"df.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Построение диаграмм"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnwAAAKSC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65D/2a2LJli7773e9q6NChSk1NVZcuXXTZZZdp8+bNzX6cgBOxwgdI9eWsS5cukup+sL3yyiu67LLL1L9/fxUXF+t///d/NXnyZK1atUo9evSQJEUiEU2fPl3vv/++rrzySv3whz9URUWF3n33Xa1YsUIDBw6sf42rrrpK5513XoPXveOOO46Y59e//rUsy9LPfvYz7dmzR3/605901llnacmSJUpNTZUk/fvf/9bUqVM1btw43XPPPXK5XHriiSd0xhln6JNPPtH48eMbPW+vXr10//33S5IqKyv1ne9854ivfdddd+nyyy/XjTfeqL179+qhhx7SqaeeqsWLFysnJ6fRY2666SadcsopkqRZs2bp5ZdfbnD7zTffrCeffFI33HCDfvCDH6ioqEgPP/ywFi9erM8++0xer/eIn4fWOHDgQP3HdqhoNKoLLrhAn376qW666SYNGzZMy5cv1x//+EetW7dOr7zyylGf8xvf+Ibuu+8+vfDCC7r11lvrtweDQc2YMUOXXHKJUlJS6revX79eV1xxhW655RZdd911euKJJ3TZZZdpzpw5mjJliiSpuLhYJ598sqqrq/WDH/xAXbp00VNPPaULLrhAM2bM0Ne+9rUGGe68804NGzZMNTU19b8IdOvWTd/61rda/TmaO3euLr/8ch177LH67W9/q+zsbJWUlOhHP/pRs49tbe4f/OAHOuGEExpsu/HGG1ud+VDDhg3TP//5z/r3H3/8ca1evVp//OMf67eNHj1akjR//nx9/vnnuvLKK9WrVy9t3rxZjz32mE477TStWrWKQzeQfGwgiTzxxBO2JPu9996z9+7da2/bts3+17/+ZXfp0sVOTU21t2/fbtu2bdfW1tqRSKTBY4uKimy/32/fd9999dv+8Y9/2JLsP/zhD41eKxqN1j9Okv3AAw80us+IESPsyZMn17//wQcf2JLsnj172uXl5fXbX3zxRVuS/ec//7n+uQcPHmyfc8459a9j27ZdXV1t9+/f354yZUqj1zr55JPtkSNH1r+/d+9eW5J9zz331G/bvHmz7Xa77V//+tcNHrt8+XLb4/E02r5+/Xpbkv3UU0/Vb7vnnnvsQ/9r+eSTT2xJ9rPPPtvgsXPmzGm0vW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969eqjPufhr3+4K664QrfddpueffZZ3X333SorK9Ps2bP1ox/9qFGpHzRoUKNtQ4YMkVR3vGNBQYG2bNmiCRMmNHqdYcOGSao79mzkyJH12y+66KL6v7tcLv33f/+3LrnkkkaPHzp0aJMfhySddNJJevjhh/XDH/5QP/3pT5Wdnd3oOMqjaW3u1jjrrLPq/56Tk6OrrrpKDzzwgNLT09v0fJJUU1Oj+++/X0888YR27NjR4LjHI5VhwOkofEhK48ePrz9L90h+85vf6K677tI3v/lN/fKXv1ReXp5cLpduu+22RitnJhzM8MADD2jMmDFHvM+hJSwYDGrXrl31x5E19byWZemtt96S2+1u8jkl1a9aFRQUNPmc3bp107PPPnvE2w8vYhMmTNCvfvWrBtsefvhhvfrqq0d8/OrVq/Xkk0/qmWeeOeKxgNFoVKNGjdIf/vCHIz6+d+/eR80uSbm5uZo+fXp94ZsxY4YCgYCuueaaJh8XKw8++KCOPfZYhUIhzZ8/X7/61a/k8Xh0zz33NLjfzJkzlZWVVf/+unXr9L3vfa/Bfa688kotWrRIDz30kB5//PFOyd8SB38BCwQC+vDDD+tPIHn00Ufb/Jzf//739cQTT+i2227TSSedpOzsbFmWpSuvvDIuvoeBzkbhA45gxowZOv300/X3v/+9wfY
|
||
|
"text/plain": [
|
||
|
"<Figure size 800x800 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"experience_counts = df['experience_level'].value_counts()\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(8, 8))\n",
|
||
|
"experience_counts.plot(kind='pie', autopct='%1.1f%%', colors=['lightcoral', 'lightgreen', 'lightblue', 'gold'])\n",
|
||
|
"plt.title('Распределение уровня опыта')\n",
|
||
|
"plt.ylabel('')\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Данная диаграмма отображает распределения уровня опыта"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKMAAAK9CAYAAAD49q/AAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD6zklEQVR4nOzdeVyVdfr/8ddh32QXEFdAVNTUslKsXBJFs0xrbKymNJ1smjarMafFSqufZYvZarZoTfptm7KmRUXUtERzTU1MRVxyAQEBAYED5/79cfDgCVRQ4Bzw/Xw8fMw59+dz7vs6tx+duPxc120yDMNARERERERERESkAbg4OgAREREREREREblwKBklIiIiIiIiIiINRskoERERERERERFpMEpGiYiIiIiIiIhIg1EySkREREREREREGoySUSIiIiIiIiIi0mCUjBIRERERERERkQajZJSIiIiIiIiIiDQYJaNERERERERERKTBKBklIiIiIiIiIiINRskoERGRs0hLS+Ouu+4iOjoaLy8v/P39ueKKK5g1axYnTpxwdHgiIiIiIo2Km6MDEBERcWbfffcdo0aNwtPTk9tvv52uXbtSWlrKTz/9xKRJk/jtt9+YM2eOo8MUEREREWk0TIZhGI4OQkRExBmlp6fTrVs3WrVqxbJly2jRooXd+O7du/nuu+944IEHHBShiIiIiEjjozI9ERGR05gxYwYFBQW8//77VRJRAO3bt7dLRJlMJu69917mz59Px44d8fLyomfPnqxcubLKZw8ePMi4ceMIDw/H09OTLl268MEHH1Qbx9NPP43JZKryq3///nbz+vfvT9euXat8/qWXXsJkMrF3717bsbKyMp599lk6dOiAp6en3XnXr19f63mni7tz5874+fnh7+9P7969Wbhwod2cVatWMWrUKNq0aYOnpyetW7fmwQcfrFL+OHbsWPz8/NizZw+JiYn4+voSGRnJtGnTOPXf1fbu3VvtvTrdPTt57urmPv3007Y5W7ZsYezYsbZSzYiICMaNG0d2drbd9z3TtU0mEytWrKjV967OvHnzzniNU+MG2LRpE0OHDsXf3x8/Pz8GDhzImjVrznqdk/fypZdeYubMmbRt2xZvb2/69evHtm3b7ObW5P4AvP3223Tv3p2AgAB8fX3p3r0777//frW/Hz169KgS0/Tp0zGZTPj5+VUZ+/jjj+nZsyfe3t4EBwczevRoDhw4YDfn5J+RDRs20KdPH7y9vYmKimL27Nm2OQUFBfj6+labZP7jjz9wdXVl+vTpZ71v8+bNsx07fvw4PXv2JCoqisOHD9uOFxYW8vDDD9O6dWs8PT3p2LEjL730En/+t+KTv7evvvpqlet16tTJ9nfPSbVZI/v27eOf//wnHTt2xNvbm5CQEEaNGmX398Wp5/zzn/usrKwq5zz5Z+FUBQUFRERE2P05AOvvyZ//XK5bt84Wq4iINE0q0xMRETmN//3vf0RHR9OnT58af+bHH3/k008/5f7778fT05O33nqLIUOG8Msvv9gSRRkZGfTu3dv2A2Tz5s354YcfGD9+PPn5+UycOLHac7/99tu2H8IfffTR8/puL7/8MlOmTGHkyJFMnjwZT09PVq1aVaXksKbzqlNYWMjIkSNp164dJ06cYN68edx4442kpKRw+eWXA/D5559TVFTE3XffTUhICL/88guvv/46f/zxB59//rnd+crLyxkyZAi9e/dmxowZLFq0iKeeeoqysjKmTZtmN/fmm2/mmmuusTt2pnsWGhrKzJkzbe9vu+02u/GkpCT27NnDHXfcQUREhK0887fffmPNmjWYTCZuuOEG2rdvb/vMgw8+SFxcHBMmTLAdi4uLq/X3Pp1p06YRFRVle19QUMDdd99tN+e3337jqquuwt/fn0ceeQR3d3feeecd+vfvz48//kivXr3Oep2PPvqI48ePc88991BcXMysWbO4+uqr2bp1K+Hh4TW+P2BNygwePJiYmBgMw+Czzz7j73//O4GBgdx44422a7q5ufHbb7+xadMmLr74YtvxefPm4eXlVSXG5557jilTpnDTTTfx97//naNHj/L666/Tt29fNm3aRGBgoG3usWPHuOaaa7jpppu4+eab+eyzz7j77rvx8PBg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VRUVGVecePHycoKOisZTA1nXc6ZrOZrKws0tLSeP7553FxceGKK66wjXt7e9teFxYWkpWVRZ8+fTAMg02bNlU536mlSCd3lpWWlrJ06dJzig+gtLQUT0/PM845Nc7i4mKysrLo3bs3QJXfr5qo7fc+F+Xl5SxZsoQRI0YQHR1tO96iRQtuueUWfvrpJ9s6P5MRI0bQsmVL2/vLL7+cXr168f3331f7fc52f06u0X379jFz5kzy8/O56qqrqlx33LhxLFiwgJKSEgDmzp3LDTfcQEBAgN28L7/8EovFwk033WS37iMiIoiNjWX58uV2893c3Ljrrrts7z08PLjrrrvIzMxkw4YNACQkJBAZGcn8+fNt87Zt28aWLVv429/+dtZ7dtKkSZOYP38+n332mW034Enff/89rq6u3H///XbHH374YQzD4IcffrA7Hh4ezrBhw5g7dy4ARUVFfPbZZ9xxxx01jqc6p/7emc1msrOzad++PYGBgdWu7by8PLv7nJOTc9ZrPPPMMwQEBFT5rn9mGAaPPvooN954Y4127YmISOOlMj0REZFq+Pv7A9ZkTG3ExsZWOdahQweKioo4evQoLi4u5ObmMmfOnNOWumVmZtq9z8rKwt3dvUblMjt27KB58+ZnnRcfH897773HO++8w7XXXounpycFBQXnPO90kpOTGTp0KGC9p1988YUtSQGwf/9+nnzySb755huOHTtm99m8vDy79y4uLnZJFbDeW6BKf5vayM3NrbYH0alycnKYOnUqn3zySZXfnz/HWRO1+d7n6ujRoxQVFdGxY8cqY3FxcVgsFg4
|
||
|
"text/plain": [
|
||
|
"<Figure size 1400x800 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"salary_by_company_size = df.groupby(['work_year', 'company_size'])['salary_in_usd'].mean().unstack()\n",
|
||
|
"\n",
|
||
|
"salary_by_company_size.plot(kind='line', figsize=(14, 8), marker='o')\n",
|
||
|
"plt.title('Средняя зарплата по размеру компании')\n",
|
||
|
"plt.xlabel('Год')\n",
|
||
|
"plt.ylabel('Средняя зарплата USD')\n",
|
||
|
"plt.xticks(rotation=0)\n",
|
||
|
"plt.legend(title='Размер компании')\n",
|
||
|
"plt.grid(True)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Данная диаграмма показывает средние зарплаты исходя из размеров компании по годам"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA2wAAAIjCAYAAAB/FZhcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAABeOElEQVR4nO3deVgVdf//8dcBZVEEFFkkcctScS00xMpSSTRa3ErNFJc0DS3FFC0DtcXSFi23bBErvTO7y0oTJdzuktQwbpfSu0WzUhQXOEoKCuf3hz/myxHUg2FnlOfjuua6PTPvmXmf4RzuXszMZyw2m80mAAAAAIDpuDi7AQAAAABA6QhsAAAAAGBSBDYAAAAAMCkCGwAAAACYFIENAAAAAEyKwAYAAAAAJkVgAwAAAACTIrABAAAAgEkR2AAAAADApAhsAAAAAGBSBDYAl5SUlCSLxSKLxaKvv/66xHKbzaaQkBBZLBbdc889TugQAHClHT16VDNmzFD79u3l7+8vX19ftW3bVkuXLi21Pi8vT/Hx8QoODpanp6fCw8OVkpJiV/PXX39pzpw56ty5s2rVqqVq1arppptu0rx581RQUGBXe+DAAT388MNq1KiRqlWrJl9fX91yyy1atGiRbDbbFXvfgLMR2AA4zMPDQ0uWLCkxf8OGDfrjjz/k7u7uhK4AAP+EtLQ0Pf3006pRo4YmTZqk559/XlWqVFGfPn2UmJhYon7gwIF69dVX1a9fP82aNUuurq66++677f7w9+uvv2rUqFGy2WyKi4vTyy+/rPr16+uxxx7T4MGD7bZ35MgR/fHHH+rVq5defvllPffcc6pVq5YGDhyop59++oq/f8BZLDb+JAHgEpKSkjRo0CD16NFDGzdu1MGDB1WpUiVj+bBhw7Rt2zYdOXJEzZo104oVK5zYLQDgSti7d69cXFxUt25dY57NZlNkZKS++eYbHT16VFWrVpUkbdmyReHh4ZoxY4aefPJJSdLp06fVrFkzBQQEaNOmTZLOhbBDhw6padOmdvsaPHiwFi5cqJ9++kkNGza8aF/33nuv1q1bp5ycHLm6upbnWwZMgTNsABzWt29fHT161O6Slvz8fH388cd66KGHSl3n5ZdfVrt27eTn5ydPT0+FhYXp448/LlFnsVg0efJk4/XZs2d19913q0aNGvrhhx/saj/44APdcsstqlKliqpXr6727dtrzZo1xvJ69epp4MCBdussW7ZMFotF9erVM+bt27fPuNRz+fLldvWnT59W9erVZbFY9PLLLxvzf/vtNz322GNq1KiRPD095efnpwceeED79u0r9f3feeedxj6KT0lJSXY1zZo1K3X984/RyJEjS8y/55577N6X5PhxP3nypMaOHasGDRqocuXKdj0eOXLkov0MHz5cN9xwg6pUqaIaNWqoY8eO+s9//mNX89lnnyk6OlrBwcFyd3fX9ddfr2effbbEpU5FxyA9PV3t2rWTp6en6tevr/nz59vVrV+/vtTjWTSd/3Mv2valfgb/+c9/9MADD6hOnTpyd3dXSEiIxowZo1OnThk1AwcOvOi+LRaL8Tlw9H2XZvLkyRfdR/G+JWnt2rW6/fbbVbVqVfn6+ur+++/Xjz/+eNF9XOo4Fv8+FvVT3MmTJxUUFCSLxaL169df8liff3xiYmJUs2ZNnTlzpkRvnTt3VqNGjS7a/5X47J3v5ZdftutZOvd76bnnntONN94od3d3u/f23XffSTr3++dix6D4dzU3N1djx45VSEiI3N3d1ahRI7388sulXt53sd97ju6z6Hfe+Z+h2NjYC35/iqtfv75dWJPO/V7q1q2b8vLy9OuvvxrzP/74Y7m6umrYsGHGPA8PDw0ZMkRpaWn6/fffJUk1a9YsEdYkqXv37pJ0yc9y0fv/66+/lJ+ff8la4GpU6dIlAHBOvXr1FBERoX/961/q2rWrJGnVqlXKyclRnz599Prrr5dYZ9asWbrvvvvUr18/5efn68MPP9QDDzygFStWKDo6+oL7euSRR7R+/XqlpKQoNDTUmD9lyhRNnjxZ7dq109SpU+Xm5qbNmzdr7dq16ty5c6nbOnv27EUvl/Hw8NDChQvVrVs3Y94nn3yi06dPl6jdunWrNm3apD59+qh27drat2+f5s2bpzvvvFM//PCDqlSpUmKdxo0bG/s/cuSIxowZc8Feyoujx33cuHGaP3++hgwZoltvvVWVK1fWJ598ok8//fSS+8jPz9fDDz+s2rVr69ixY3rzzTfVpUsX/fjjj6pTp46kc2dnvby8FBcXJy8vL61du1YJCQmyWq2aMWOG3faOHz+uu+++Ww8++KD69u2rjz76SCNGjJCbm1uJS6Mef/xxtWnTxm7eI488csFeL/UzWLZsmf766y+NGDFCfn5+2rJli9544w398ccfWrZsmSTp0UcfVWRkpLFO//791b17d/Xo0cOY5+/vX+b3fSHz5s2Tl5eX8Xrv3r1KSEiwq/nqq6/UtWtXNWjQQJMnT9apU6f0xhtv6NZbb9W2bdtKBPkiTZo00fvvv2+8XrBggX788Ue99tprxrwWLVpcsLdXXnlFhw4dKnVZ7dq1NW3aNLt5X375pf71r38Zr/v376/33ntPq1evtrvvNTMzU2vXri318rriyvuz56hXXnlFzzzzjLp37674+Hi5u7vrP//5jxYsWGDUzJw5UydPnpR0Lmy88MILeuqpp9SkSRNJMn6mNptN9913n9atW6chQ4aoVatWWr16tcaNG6c///zT7mdxqd97ju6zND///LPeeuutyzoeRTIzMyWdC19Fvv/+e914443y9va2q73lllskSRkZGQoJCSnTNoucOnVKubm5OnnypDZs2KCFCxcqIiJCnp6ef+t9AKZlA4BLWLhwoU2SbevWrbbZs2fbqlWrZvvrr79sNpvN9sADD9g6dOhgs9lstrp169qio6Pt1i2qK5Kfn29r1qyZrWPHjnbzJdkSExNtNpvNNnHiRJurq6tt+fLldjU//fSTzcXFxda9e3dbQUGB3bLCwkLj33Xr1rXFxMQYr+fOnWtzd3e3dejQwVa3bl1j/t69e22SbH379rVVqlTJlpmZaSzr1KmT7aGHHrJJss2YMeOC78dms9nS0tJskmzvvfdeiWW33nqrcXyK73PhwoXGvDvuuMPWtGnTEuueT5ItNja2xPzo6Gi791Vanxc67rVq1bJFRUXZzUtMTLRJsmVlZV2yp+K2bNlik2T7+OOPL9iHzWazPfroo7YqVarYTp8+bcy74447bJJsr7zyijEvLy/P1qpVK1tAQIAtPz/fZrPZbOvWrbNJsi1btqzEdqtWrWr3cy/iyM+gtD6nTZtms1gstt9++63U91v8M3s+R993aS50/Ldu3Vqi76Ljc/ToUWPef//7X5uLi4ttwIABF91PcTExMSU+Q+f3U+Tw4cO2atWq2bp27WqTZFu3bp2x7EKf5RkzZtgk2fbu3Wuz2Wy2goICW+3atW29e/e2q3v11VdtFovF9uuvvzrcu8329z97jvRss9lsERERtiZNmtj9vin++/F8RZ/X4seoyPLly22SbM8995zd/F69etksFovt559/ttlsjv/ec2SfpX32H3zwQVuzZs1sISEhpX5/LuXo0aO2gIAA2+233243v2nTpiV+39hsNtuuXbtskmzz58+/4Dbz8vJsoaGhtvr169vOnDlTYvm0adNskoypU6dOtv3795e5d+BqwSWRAMrkwQcf1KlTp7RixQqdOHFCK1asuODlkJLs/uJ5/Phx5eTk6Pbbb9e2bdtKrZ89e7amTZum119/Xffff7/dsuXLl6uwsFAJCQlycbH/9XX+JVtF/vrrL02dOlUjR440/vJ+vptvvllNmzY1zjj89ttvWrduXamXBxV/P2fOnNHRo0fVsGFD+fr6lvqe8vPzHRqMpaCgQEeOHNGRI0cuelnP6dOnjbqiqbTLyhw97idOnJCfn98l+7tUPz/++KNmzZolT09PtW7dutQ+Tpw4oSNHjuj222/XX3/9pd27d9ttq1KlSnr00UeN125ubnr00Ud1+PBhpaenX3a
|
||
|
"text/plain": [
|
||
|
"<Figure size 1000x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"df_slice = df.iloc[1:3753]\n",
|
||
|
"last_years = df_slice['work_year'].max()\n",
|
||
|
"df_filtr = df_slice[df_slice['work_year'] == last_years]\n",
|
||
|
"salary_by_employment_type = df_filtr.groupby('employment_type')['salary_in_usd'].max()\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=(10, 6))\n",
|
||
|
"salary_by_employment_type.plot(kind='bar', color='purple')\n",
|
||
|
"plt.title(f'Максимальная зарплата по типу занятости {last_years}')\n",
|
||
|
"plt.xlabel('Тип занятости')\n",
|
||
|
"plt.ylabel('Зарплата USD')\n",
|
||
|
"plt.xticks(rotation=0)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Данная диаграмма показывает максимальную зарплату исходя из типа занятости за последний год (не учитывая первую и последнюю строки датасета)"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"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
|
||
|
}
|