ium_478839/IUM02-zadanie.ipynb

1732 lines
62 KiB
Plaintext
Raw Normal View History

2022-03-21 00:28:35 +01:00
{
"cells": [
{
"cell_type": "markdown",
"id": "35c89384",
"metadata": {},
"source": [
"1. Pobieranie zbioru"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f6b42d4e",
"metadata": {},
"outputs": [],
"source": [
"!kaggle datasets download -d slehkyi/extended-football-stats-for-european-leagues-xg"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fc6b4624",
"metadata": {},
"outputs": [],
"source": [
"!unzip -o extended-football-stats-for-european-leagues-xg.zip"
]
},
{
"cell_type": "markdown",
"id": "1836fa83",
"metadata": {},
"source": [
"2. Podzial na podzbiory"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "051a972d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"685 understat.csv\r\n"
]
}
],
"source": [
"!wc -l understat.csv"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "c7bd95e0",
"metadata": {},
"outputs": [],
"source": [
"! head -n -1 understat.csv | shuf > understat.csv.shuf"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "1a57aec3",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 685 understat.csv\r\n",
" 137 understat.csv.dev\r\n",
" 137 understat.csv.test\r\n",
" 410 understat.csv.train\r\n",
" 1369 total\r\n"
]
}
],
"source": [
"!head -n 137 understat.csv.shuf > understat.csv.test\n",
"!head -n 274 understat.csv.shuf | tail -n 137 > understat.csv.dev\n",
"!tail -n +275 understat.csv.shuf > understat.csv.train\n",
"!rm understat.csv.shuf\n",
"!wc -l understat.csv*"
]
},
{
"cell_type": "markdown",
"id": "4f45db5f",
"metadata": {},
"source": [
"3. Statystki dla zbiorow i podzbiorow"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "c990b05f",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"understat = pd.read_csv('understat.csv')\n",
"understat_test = pd.read_csv('understat.csv.test')\n",
"understat_dev = pd.read_csv('understat.csv.dev')\n",
"understat_train = pd.read_csv('understat.csv.train')"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "f3f11fd4",
"metadata": {},
"outputs": [
{
"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>league</th>\n",
" <th>year</th>\n",
" <th>position</th>\n",
" <th>team</th>\n",
" <th>matches</th>\n",
" <th>wins</th>\n",
" <th>draws</th>\n",
" <th>loses</th>\n",
" <th>scored</th>\n",
" <th>missed</th>\n",
" <th>...</th>\n",
" <th>xGA</th>\n",
" <th>xGA_diff</th>\n",
" <th>npxGA</th>\n",
" <th>npxGD</th>\n",
" <th>ppda_coef</th>\n",
" <th>oppda_coef</th>\n",
" <th>deep</th>\n",
" <th>deep_allowed</th>\n",
" <th>xpts</th>\n",
" <th>xpts_diff</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>684</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>...</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>6.840000e+02</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" <td>684.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>168</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>top</th>\n",
" <td>La_liga</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Barcelona</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>freq</th>\n",
" <td>120</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>NaN</td>\n",
" <td>2016.500000</td>\n",
" <td>10.061404</td>\n",
" <td>NaN</td>\n",
" <td>35.935673</td>\n",
" <td>13.434211</td>\n",
" <td>9.067251</td>\n",
" <td>13.434211</td>\n",
" <td>48.190058</td>\n",
" <td>48.190058</td>\n",
" <td>...</td>\n",
" <td>47.064744</td>\n",
" <td>-1.125315</td>\n",
" <td>42.902596</td>\n",
" <td>-4.155221e-17</td>\n",
" <td>10.911784</td>\n",
" <td>10.911772</td>\n",
" <td>208.676901</td>\n",
" <td>208.676901</td>\n",
" <td>49.539598</td>\n",
" <td>0.169715</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>NaN</td>\n",
" <td>1.709075</td>\n",
" <td>5.580165</td>\n",
" <td>NaN</td>\n",
" <td>3.203487</td>\n",
" <td>5.880962</td>\n",
" <td>2.941824</td>\n",
" <td>5.510278</td>\n",
" <td>17.605374</td>\n",
" <td>13.866509</td>\n",
" <td>...</td>\n",
" <td>11.781399</td>\n",
" <td>6.663632</td>\n",
" <td>11.002013</td>\n",
" <td>1.929269e+01</td>\n",
" <td>2.521398</td>\n",
" <td>3.301410</td>\n",
" <td>83.888073</td>\n",
" <td>54.713624</td>\n",
" <td>13.559213</td>\n",
" <td>7.156998</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>NaN</td>\n",
" <td>2014.000000</td>\n",
" <td>1.000000</td>\n",
" <td>NaN</td>\n",
" <td>27.000000</td>\n",
" <td>2.000000</td>\n",
" <td>2.000000</td>\n",
" <td>1.000000</td>\n",
" <td>13.000000</td>\n",
" <td>15.000000</td>\n",
" <td>...</td>\n",
" <td>16.838674</td>\n",
" <td>-29.175087</td>\n",
" <td>16.084399</td>\n",
" <td>-4.220877e+01</td>\n",
" <td>5.683535</td>\n",
" <td>4.394458</td>\n",
" <td>76.000000</td>\n",
" <td>83.000000</td>\n",
" <td>17.907700</td>\n",
" <td>-24.721600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>NaN</td>\n",
" <td>2015.000000</td>\n",
" <td>5.000000</td>\n",
" <td>NaN</td>\n",
" <td>34.000000</td>\n",
" <td>9.000000</td>\n",
" <td>7.000000</td>\n",
" <td>9.000000</td>\n",
" <td>36.000000</td>\n",
" <td>38.000000</td>\n",
" <td>...</td>\n",
" <td>38.916186</td>\n",
" <td>-5.698828</td>\n",
" <td>35.474606</td>\n",
" <td>-1.325816e+01</td>\n",
" <td>9.090617</td>\n",
" <td>8.809866</td>\n",
" <td>151.750000</td>\n",
" <td>170.000000</td>\n",
" <td>39.466550</td>\n",
" <td>-4.498400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>NaN</td>\n",
" <td>2016.500000</td>\n",
" <td>10.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>12.000000</td>\n",
" <td>9.000000</td>\n",
" <td>14.000000</td>\n",
" <td>45.000000</td>\n",
" <td>48.000000</td>\n",
" <td>...</td>\n",
" <td>47.310924</td>\n",
" <td>-0.918895</td>\n",
" <td>43.031911</td>\n",
" <td>-3.127901e+00</td>\n",
" <td>10.562543</td>\n",
" <td>10.347047</td>\n",
" <td>188.000000</td>\n",
" <td>205.000000</td>\n",
" <td>47.102100</td>\n",
" <td>0.116050</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>NaN</td>\n",
" <td>2018.000000</td>\n",
" <td>15.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>16.000000</td>\n",
" <td>11.000000</td>\n",
" <td>17.000000</td>\n",
" <td>56.000000</td>\n",
" <td>58.000000</td>\n",
" <td>...</td>\n",
" <td>54.834899</td>\n",
" <td>3.381834</td>\n",
" <td>50.263465</td>\n",
" <td>9.740049e+00</td>\n",
" <td>12.434874</td>\n",
" <td>12.187434</td>\n",
" <td>242.000000</td>\n",
" <td>246.250000</td>\n",
" <td>56.942025</td>\n",
" <td>4.912775</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>NaN</td>\n",
" <td>2019.000000</td>\n",
" <td>20.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>32.000000</td>\n",
" <td>18.000000</td>\n",
" <td>29.000000</td>\n",
" <td>118.000000</td>\n",
" <td>94.000000</td>\n",
" <td>...</td>\n",
" <td>88.432186</td>\n",
" <td>16.370737</td>\n",
" <td>78.535447</td>\n",
" <td>7.304931e+01</td>\n",
" <td>21.896752</td>\n",
" <td>30.468113</td>\n",
" <td>582.000000</td>\n",
" <td>375.000000</td>\n",
" <td>94.380000</td>\n",
" <td>23.047500</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>11 rows × 24 columns</p>\n",
"</div>"
],
"text/plain": [
" league year position team matches wins \\\n",
"count 684 684.000000 684.000000 684 684.000000 684.000000 \n",
"unique 6 NaN NaN 168 NaN NaN \n",
"top La_liga NaN NaN Barcelona NaN NaN \n",
"freq 120 NaN NaN 6 NaN NaN \n",
"mean NaN 2016.500000 10.061404 NaN 35.935673 13.434211 \n",
"std NaN 1.709075 5.580165 NaN 3.203487 5.880962 \n",
"min NaN 2014.000000 1.000000 NaN 27.000000 2.000000 \n",
"25% NaN 2015.000000 5.000000 NaN 34.000000 9.000000 \n",
"50% NaN 2016.500000 10.000000 NaN 38.000000 12.000000 \n",
"75% NaN 2018.000000 15.000000 NaN 38.000000 16.000000 \n",
"max NaN 2019.000000 20.000000 NaN 38.000000 32.000000 \n",
"\n",
" draws loses scored missed ... xGA \\\n",
"count 684.000000 684.000000 684.000000 684.000000 ... 684.000000 \n",
"unique NaN NaN NaN NaN ... NaN \n",
"top NaN NaN NaN NaN ... NaN \n",
"freq NaN NaN NaN NaN ... NaN \n",
"mean 9.067251 13.434211 48.190058 48.190058 ... 47.064744 \n",
"std 2.941824 5.510278 17.605374 13.866509 ... 11.781399 \n",
"min 2.000000 1.000000 13.000000 15.000000 ... 16.838674 \n",
"25% 7.000000 9.000000 36.000000 38.000000 ... 38.916186 \n",
"50% 9.000000 14.000000 45.000000 48.000000 ... 47.310924 \n",
"75% 11.000000 17.000000 56.000000 58.000000 ... 54.834899 \n",
"max 18.000000 29.000000 118.000000 94.000000 ... 88.432186 \n",
"\n",
" xGA_diff npxGA npxGD ppda_coef oppda_coef \\\n",
"count 684.000000 684.000000 6.840000e+02 684.000000 684.000000 \n",
"unique NaN NaN NaN NaN NaN \n",
"top NaN NaN NaN NaN NaN \n",
"freq NaN NaN NaN NaN NaN \n",
"mean -1.125315 42.902596 -4.155221e-17 10.911784 10.911772 \n",
"std 6.663632 11.002013 1.929269e+01 2.521398 3.301410 \n",
"min -29.175087 16.084399 -4.220877e+01 5.683535 4.394458 \n",
"25% -5.698828 35.474606 -1.325816e+01 9.090617 8.809866 \n",
"50% -0.918895 43.031911 -3.127901e+00 10.562543 10.347047 \n",
"75% 3.381834 50.263465 9.740049e+00 12.434874 12.187434 \n",
"max 16.370737 78.535447 7.304931e+01 21.896752 30.468113 \n",
"\n",
" deep deep_allowed xpts xpts_diff \n",
"count 684.000000 684.000000 684.000000 684.000000 \n",
"unique NaN NaN NaN NaN \n",
"top NaN NaN NaN NaN \n",
"freq NaN NaN NaN NaN \n",
"mean 208.676901 208.676901 49.539598 0.169715 \n",
"std 83.888073 54.713624 13.559213 7.156998 \n",
"min 76.000000 83.000000 17.907700 -24.721600 \n",
"25% 151.750000 170.000000 39.466550 -4.498400 \n",
"50% 188.000000 205.000000 47.102100 0.116050 \n",
"75% 242.000000 246.250000 56.942025 4.912775 \n",
"max 582.000000 375.000000 94.380000 23.047500 \n",
"\n",
"[11 rows x 24 columns]"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"understat.describe(include='all')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "dff41fad",
"metadata": {},
"outputs": [
{
"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>RFPL</th>\n",
" <th>2017</th>\n",
" <th>2</th>\n",
" <th>CSKA Moscow</th>\n",
" <th>30</th>\n",
" <th>17</th>\n",
" <th>7</th>\n",
" <th>6</th>\n",
" <th>49</th>\n",
" <th>23</th>\n",
" <th>...</th>\n",
" <th>26.553496500000005</th>\n",
" <th>3.553496500000005</th>\n",
" <th>25.799216500000004</th>\n",
" <th>14.6282485</th>\n",
" <th>8.39239590426995</th>\n",
" <th>17.543143498963673</th>\n",
" <th>359</th>\n",
" <th>142</th>\n",
" <th>53.6637</th>\n",
" <th>-4.336300000000001</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>409</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>...</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" <td>409.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>154</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>top</th>\n",
" <td>La_liga</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Sevilla</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>freq</th>\n",
" <td>72</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>NaN</td>\n",
" <td>2016.555012</td>\n",
" <td>10.078240</td>\n",
" <td>NaN</td>\n",
" <td>35.926650</td>\n",
" <td>13.420538</td>\n",
" <td>8.953545</td>\n",
" <td>13.552567</td>\n",
" <td>48.237164</td>\n",
" <td>48.530562</td>\n",
" <td>...</td>\n",
" <td>47.483894</td>\n",
" <td>-1.046669</td>\n",
" <td>43.234835</td>\n",
" <td>-0.315175</td>\n",
" <td>10.973088</td>\n",
" <td>10.935122</td>\n",
" <td>208.953545</td>\n",
" <td>211.022005</td>\n",
" <td>49.274601</td>\n",
" <td>0.059443</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>NaN</td>\n",
" <td>1.694145</td>\n",
" <td>5.688287</td>\n",
" <td>NaN</td>\n",
" <td>3.182288</td>\n",
" <td>5.887355</td>\n",
" <td>2.968840</td>\n",
" <td>5.740107</td>\n",
" <td>17.244493</td>\n",
" <td>14.469700</td>\n",
" <td>...</td>\n",
" <td>12.100055</td>\n",
" <td>6.716821</td>\n",
" <td>11.334304</td>\n",
" <td>19.385648</td>\n",
" <td>2.484830</td>\n",
" <td>3.311480</td>\n",
" <td>86.559910</td>\n",
" <td>54.427520</td>\n",
" <td>13.492874</td>\n",
" <td>7.167367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>NaN</td>\n",
" <td>2014.000000</td>\n",
" <td>1.000000</td>\n",
" <td>NaN</td>\n",
" <td>28.000000</td>\n",
" <td>2.000000</td>\n",
" <td>2.000000</td>\n",
" <td>1.000000</td>\n",
" <td>13.000000</td>\n",
" <td>15.000000</td>\n",
" <td>...</td>\n",
" <td>19.619785</td>\n",
" <td>-29.175087</td>\n",
" <td>18.111234</td>\n",
" <td>-42.208772</td>\n",
" <td>5.683535</td>\n",
" <td>4.394458</td>\n",
" <td>76.000000</td>\n",
" <td>83.000000</td>\n",
" <td>17.907700</td>\n",
" <td>-24.531500</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>NaN</td>\n",
" <td>2015.000000</td>\n",
" <td>5.000000</td>\n",
" <td>NaN</td>\n",
" <td>34.000000</td>\n",
" <td>10.000000</td>\n",
" <td>7.000000</td>\n",
" <td>9.000000</td>\n",
" <td>36.000000</td>\n",
" <td>38.000000</td>\n",
" <td>...</td>\n",
" <td>39.113520</td>\n",
" <td>-5.593184</td>\n",
" <td>35.744719</td>\n",
" <td>-13.740542</td>\n",
" <td>9.175663</td>\n",
" <td>8.774373</td>\n",
" <td>151.000000</td>\n",
" <td>172.000000</td>\n",
" <td>39.339700</td>\n",
" <td>-4.249000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>NaN</td>\n",
" <td>2017.000000</td>\n",
" <td>10.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>12.000000</td>\n",
" <td>9.000000</td>\n",
" <td>14.000000</td>\n",
" <td>45.000000</td>\n",
" <td>49.000000</td>\n",
" <td>...</td>\n",
" <td>48.003810</td>\n",
" <td>-0.892313</td>\n",
" <td>43.858446</td>\n",
" <td>-3.716268</td>\n",
" <td>10.691325</td>\n",
" <td>10.384529</td>\n",
" <td>186.000000</td>\n",
" <td>208.000000</td>\n",
" <td>46.693900</td>\n",
" <td>0.081300</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>NaN</td>\n",
" <td>2018.000000</td>\n",
" <td>15.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>16.000000</td>\n",
" <td>11.000000</td>\n",
" <td>18.000000</td>\n",
" <td>56.000000</td>\n",
" <td>59.000000</td>\n",
" <td>...</td>\n",
" <td>55.334056</td>\n",
" <td>3.075720</td>\n",
" <td>50.595009</td>\n",
" <td>10.044548</td>\n",
" <td>12.457197</td>\n",
" <td>12.303380</td>\n",
" <td>243.000000</td>\n",
" <td>249.000000</td>\n",
" <td>56.865400</td>\n",
" <td>4.907700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>NaN</td>\n",
" <td>2019.000000</td>\n",
" <td>20.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>32.000000</td>\n",
" <td>18.000000</td>\n",
" <td>29.000000</td>\n",
" <td>116.000000</td>\n",
" <td>94.000000</td>\n",
" <td>...</td>\n",
" <td>78.863255</td>\n",
" <td>15.540152</td>\n",
" <td>72.013818</td>\n",
" <td>73.049305</td>\n",
" <td>21.896752</td>\n",
" <td>30.468113</td>\n",
" <td>582.000000</td>\n",
" <td>375.000000</td>\n",
" <td>94.380000</td>\n",
" <td>23.047500</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>11 rows × 24 columns</p>\n",
"</div>"
],
"text/plain": [
" RFPL 2017 2 CSKA Moscow 30 17 \\\n",
"count 409 409.000000 409.000000 409 409.000000 409.000000 \n",
"unique 6 NaN NaN 154 NaN NaN \n",
"top La_liga NaN NaN Sevilla NaN NaN \n",
"freq 72 NaN NaN 6 NaN NaN \n",
"mean NaN 2016.555012 10.078240 NaN 35.926650 13.420538 \n",
"std NaN 1.694145 5.688287 NaN 3.182288 5.887355 \n",
"min NaN 2014.000000 1.000000 NaN 28.000000 2.000000 \n",
"25% NaN 2015.000000 5.000000 NaN 34.000000 10.000000 \n",
"50% NaN 2017.000000 10.000000 NaN 38.000000 12.000000 \n",
"75% NaN 2018.000000 15.000000 NaN 38.000000 16.000000 \n",
"max NaN 2019.000000 20.000000 NaN 38.000000 32.000000 \n",
"\n",
" 7 6 49 23 ... \\\n",
"count 409.000000 409.000000 409.000000 409.000000 ... \n",
"unique NaN NaN NaN NaN ... \n",
"top NaN NaN NaN NaN ... \n",
"freq NaN NaN NaN NaN ... \n",
"mean 8.953545 13.552567 48.237164 48.530562 ... \n",
"std 2.968840 5.740107 17.244493 14.469700 ... \n",
"min 2.000000 1.000000 13.000000 15.000000 ... \n",
"25% 7.000000 9.000000 36.000000 38.000000 ... \n",
"50% 9.000000 14.000000 45.000000 49.000000 ... \n",
"75% 11.000000 18.000000 56.000000 59.000000 ... \n",
"max 18.000000 29.000000 116.000000 94.000000 ... \n",
"\n",
" 26.553496500000005 3.553496500000005 25.799216500000004 14.6282485 \\\n",
"count 409.000000 409.000000 409.000000 409.000000 \n",
"unique NaN NaN NaN NaN \n",
"top NaN NaN NaN NaN \n",
"freq NaN NaN NaN NaN \n",
"mean 47.483894 -1.046669 43.234835 -0.315175 \n",
"std 12.100055 6.716821 11.334304 19.385648 \n",
"min 19.619785 -29.175087 18.111234 -42.208772 \n",
"25% 39.113520 -5.593184 35.744719 -13.740542 \n",
"50% 48.003810 -0.892313 43.858446 -3.716268 \n",
"75% 55.334056 3.075720 50.595009 10.044548 \n",
"max 78.863255 15.540152 72.013818 73.049305 \n",
"\n",
" 8.39239590426995 17.543143498963673 359 142 \\\n",
"count 409.000000 409.000000 409.000000 409.000000 \n",
"unique NaN NaN NaN NaN \n",
"top NaN NaN NaN NaN \n",
"freq NaN NaN NaN NaN \n",
"mean 10.973088 10.935122 208.953545 211.022005 \n",
"std 2.484830 3.311480 86.559910 54.427520 \n",
"min 5.683535 4.394458 76.000000 83.000000 \n",
"25% 9.175663 8.774373 151.000000 172.000000 \n",
"50% 10.691325 10.384529 186.000000 208.000000 \n",
"75% 12.457197 12.303380 243.000000 249.000000 \n",
"max 21.896752 30.468113 582.000000 375.000000 \n",
"\n",
" 53.6637 -4.336300000000001 \n",
"count 409.000000 409.000000 \n",
"unique NaN NaN \n",
"top NaN NaN \n",
"freq NaN NaN \n",
"mean 49.274601 0.059443 \n",
"std 13.492874 7.167367 \n",
"min 17.907700 -24.531500 \n",
"25% 39.339700 -4.249000 \n",
"50% 46.693900 0.081300 \n",
"75% 56.865400 4.907700 \n",
"max 94.380000 23.047500 \n",
"\n",
"[11 rows x 24 columns]"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"understat_train.describe(include='all')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "09df70ef",
"metadata": {},
"outputs": [
{
"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>Serie_A</th>\n",
" <th>2014</th>\n",
" <th>14</th>\n",
" <th>Chievo</th>\n",
" <th>38</th>\n",
" <th>10</th>\n",
" <th>13</th>\n",
" <th>15</th>\n",
" <th>28</th>\n",
" <th>41</th>\n",
" <th>...</th>\n",
" <th>48.985331</th>\n",
" <th>7.985331000000002</th>\n",
" <th>45.940138</th>\n",
" <th>-14.449114999999999</th>\n",
" <th>10.139687089062235</th>\n",
" <th>6.794036856172734</th>\n",
" <th>173</th>\n",
" <th>247</th>\n",
" <th>41.4148</th>\n",
" <th>-1.5852000000000004</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>135</td>\n",
" <td>135.000000</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>...</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>20</td>\n",
" <td>91</td>\n",
" <td>6</td>\n",
" <td>21</td>\n",
" <td>16</td>\n",
" <td>23</td>\n",
" <td>56</td>\n",
" <td>55</td>\n",
" <td>...</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" <td>103</td>\n",
" <td>99</td>\n",
" <td>136</td>\n",
" <td>136</td>\n",
" </tr>\n",
" <tr>\n",
" <th>top</th>\n",
" <td>Ligue_1</td>\n",
" <td>NaN</td>\n",
" <td>9</td>\n",
" <td>Reims</td>\n",
" <td>38</td>\n",
" <td>9</td>\n",
" <td>8</td>\n",
" <td>14</td>\n",
" <td>45</td>\n",
" <td>54</td>\n",
" <td>...</td>\n",
" <td>26.467583</td>\n",
" <td>5.467583000000001</td>\n",
" <td>21.670482000000003</td>\n",
" <td>3.456094</td>\n",
" <td>12.46602209686978</td>\n",
" <td>11.198320780244606</td>\n",
" <td>132</td>\n",
" <td>215</td>\n",
" <td>40.4213</td>\n",
" <td>-0.5786999999999978</td>\n",
" </tr>\n",
" <tr>\n",
" <th>freq</th>\n",
" <td>25</td>\n",
" <td>NaN</td>\n",
" <td>13</td>\n",
" <td>4</td>\n",
" <td>83</td>\n",
" <td>19</td>\n",
" <td>22</td>\n",
" <td>13</td>\n",
" <td>8</td>\n",
" <td>9</td>\n",
" <td>...</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>4</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>NaN</td>\n",
" <td>2016.533333</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>NaN</td>\n",
" <td>1.756863</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>NaN</td>\n",
" <td>2014.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>NaN</td>\n",
" <td>2015.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>NaN</td>\n",
" <td>2016.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>NaN</td>\n",
" <td>2018.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>NaN</td>\n",
" <td>2019.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>11 rows × 24 columns</p>\n",
"</div>"
],
"text/plain": [
" Serie_A 2014 14 Chievo 38 10 13 15 28 41 ... \\\n",
"count 135 135.000000 136 136 136 136 136 136 136 136 ... \n",
"unique 6 NaN 20 91 6 21 16 23 56 55 ... \n",
"top Ligue_1 NaN 9 Reims 38 9 8 14 45 54 ... \n",
"freq 25 NaN 13 4 83 19 22 13 8 9 ... \n",
"mean NaN 2016.533333 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"std NaN 1.756863 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"min NaN 2014.000000 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"25% NaN 2015.000000 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"50% NaN 2016.000000 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"75% NaN 2018.000000 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"max NaN 2019.000000 NaN NaN NaN NaN NaN NaN NaN NaN ... \n",
"\n",
" 48.985331 7.985331000000002 45.940138 -14.449114999999999 \\\n",
"count 136 136 136 136 \n",
"unique 136 136 136 136 \n",
"top 26.467583 5.467583000000001 21.670482000000003 3.456094 \n",
"freq 1 1 1 1 \n",
"mean NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN \n",
"\n",
" 10.139687089062235 6.794036856172734 173 247 41.4148 \\\n",
"count 136 136 136 136 136 \n",
"unique 136 136 103 99 136 \n",
"top 12.46602209686978 11.198320780244606 132 215 40.4213 \n",
"freq 1 1 4 4 1 \n",
"mean NaN NaN NaN NaN NaN \n",
"std NaN NaN NaN NaN NaN \n",
"min NaN NaN NaN NaN NaN \n",
"25% NaN NaN NaN NaN NaN \n",
"50% NaN NaN NaN NaN NaN \n",
"75% NaN NaN NaN NaN NaN \n",
"max NaN NaN NaN NaN NaN \n",
"\n",
" -1.5852000000000004 \n",
"count 136 \n",
"unique 136 \n",
"top -0.5786999999999978 \n",
"freq 1 \n",
"mean NaN \n",
"std NaN \n",
"min NaN \n",
"25% NaN \n",
"50% NaN \n",
"75% NaN \n",
"max NaN \n",
"\n",
"[11 rows x 24 columns]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"understat_dev.describe(include='all')"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "c045a17c",
"metadata": {},
"outputs": [
{
"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>EPL</th>\n",
" <th>2015</th>\n",
" <th>20</th>\n",
" <th>Aston Villa</th>\n",
" <th>38</th>\n",
" <th>3</th>\n",
" <th>8</th>\n",
" <th>27</th>\n",
" <th>27.1</th>\n",
" <th>76</th>\n",
" <th>...</th>\n",
" <th>59.009572999999996</th>\n",
" <th>-16.990427000000004</th>\n",
" <th>55.203728000000005</th>\n",
" <th>-30.199010599999994</th>\n",
" <th>13.835949475203492</th>\n",
" <th>7.984215614090003</th>\n",
" <th>136</th>\n",
" <th>300</th>\n",
" <th>29.814</th>\n",
" <th>12.814</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>136</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>...</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" <td>136.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>6</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>88</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>top</th>\n",
" <td>Serie_A</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>Liverpool</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>freq</th>\n",
" <td>28</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>5</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>NaN</td>\n",
" <td>2016.308824</td>\n",
" <td>9.897059</td>\n",
" <td>NaN</td>\n",
" <td>36.257353</td>\n",
" <td>14.036765</td>\n",
" <td>9.235294</td>\n",
" <td>12.985294</td>\n",
" <td>49.992647</td>\n",
" <td>47.161765</td>\n",
" <td>...</td>\n",
" <td>45.649438</td>\n",
" <td>-1.512327</td>\n",
" <td>41.882987</td>\n",
" <td>2.751728</td>\n",
" <td>10.485561</td>\n",
" <td>11.226170</td>\n",
" <td>217.455882</td>\n",
" <td>199.213235</td>\n",
" <td>51.969418</td>\n",
" <td>0.623829</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>NaN</td>\n",
" <td>1.697557</td>\n",
" <td>5.742989</td>\n",
" <td>NaN</td>\n",
" <td>3.119820</td>\n",
" <td>6.292156</td>\n",
" <td>2.982009</td>\n",
" <td>5.458239</td>\n",
" <td>19.156469</td>\n",
" <td>12.035885</td>\n",
" <td>...</td>\n",
" <td>10.421890</td>\n",
" <td>6.119189</td>\n",
" <td>9.769518</td>\n",
" <td>19.764675</td>\n",
" <td>2.525851</td>\n",
" <td>3.898035</td>\n",
" <td>87.269176</td>\n",
" <td>53.453255</td>\n",
" <td>13.772017</td>\n",
" <td>7.601079</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>NaN</td>\n",
" <td>2014.000000</td>\n",
" <td>1.000000</td>\n",
" <td>NaN</td>\n",
" <td>27.000000</td>\n",
" <td>3.000000</td>\n",
" <td>2.000000</td>\n",
" <td>1.000000</td>\n",
" <td>22.000000</td>\n",
" <td>17.000000</td>\n",
" <td>...</td>\n",
" <td>16.838674</td>\n",
" <td>-15.126091</td>\n",
" <td>16.084399</td>\n",
" <td>-38.185295</td>\n",
" <td>6.404365</td>\n",
" <td>5.579031</td>\n",
" <td>82.000000</td>\n",
" <td>87.000000</td>\n",
" <td>25.071500</td>\n",
" <td>-24.721600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25%</th>\n",
" <td>NaN</td>\n",
" <td>2015.000000</td>\n",
" <td>5.000000</td>\n",
" <td>NaN</td>\n",
" <td>34.000000</td>\n",
" <td>9.000000</td>\n",
" <td>8.000000</td>\n",
" <td>10.000000</td>\n",
" <td>36.000000</td>\n",
" <td>39.750000</td>\n",
" <td>...</td>\n",
" <td>38.312105</td>\n",
" <td>-5.828530</td>\n",
" <td>35.044259</td>\n",
" <td>-10.859336</td>\n",
" <td>8.502879</td>\n",
" <td>8.652774</td>\n",
" <td>157.750000</td>\n",
" <td>164.000000</td>\n",
" <td>42.223750</td>\n",
" <td>-4.768925</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50%</th>\n",
" <td>NaN</td>\n",
" <td>2016.000000</td>\n",
" <td>10.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>13.000000</td>\n",
" <td>9.000000</td>\n",
" <td>13.500000</td>\n",
" <td>44.500000</td>\n",
" <td>48.000000</td>\n",
" <td>...</td>\n",
" <td>45.576085</td>\n",
" <td>-1.550316</td>\n",
" <td>41.725086</td>\n",
" <td>-1.475171</td>\n",
" <td>10.096481</td>\n",
" <td>10.718674</td>\n",
" <td>197.000000</td>\n",
" <td>191.500000</td>\n",
" <td>50.442600</td>\n",
" <td>1.283950</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>NaN</td>\n",
" <td>2018.000000</td>\n",
" <td>14.250000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>18.000000</td>\n",
" <td>11.000000</td>\n",
" <td>17.000000</td>\n",
" <td>59.000000</td>\n",
" <td>55.000000</td>\n",
" <td>...</td>\n",
" <td>51.834812</td>\n",
" <td>3.352319</td>\n",
" <td>48.188921</td>\n",
" <td>11.734464</td>\n",
" <td>11.948190</td>\n",
" <td>12.374883</td>\n",
" <td>242.250000</td>\n",
" <td>225.250000</td>\n",
" <td>59.790125</td>\n",
" <td>6.092850</td>\n",
" </tr>\n",
" <tr>\n",
" <th>max</th>\n",
" <td>NaN</td>\n",
" <td>2019.000000</td>\n",
" <td>20.000000</td>\n",
" <td>NaN</td>\n",
" <td>38.000000</td>\n",
" <td>32.000000</td>\n",
" <td>18.000000</td>\n",
" <td>27.000000</td>\n",
" <td>107.000000</td>\n",
" <td>78.000000</td>\n",
" <td>...</td>\n",
" <td>72.709620</td>\n",
" <td>11.943205</td>\n",
" <td>66.619420</td>\n",
" <td>58.818903</td>\n",
" <td>19.517768</td>\n",
" <td>26.967792</td>\n",
" <td>547.000000</td>\n",
" <td>364.000000</td>\n",
" <td>86.756400</td>\n",
" <td>20.158700</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>11 rows × 24 columns</p>\n",
"</div>"
],
"text/plain": [
" EPL 2015 20 Aston Villa 38 3 \\\n",
"count 136 136.000000 136.000000 136 136.000000 136.000000 \n",
"unique 6 NaN NaN 88 NaN NaN \n",
"top Serie_A NaN NaN Liverpool NaN NaN \n",
"freq 28 NaN NaN 5 NaN NaN \n",
"mean NaN 2016.308824 9.897059 NaN 36.257353 14.036765 \n",
"std NaN 1.697557 5.742989 NaN 3.119820 6.292156 \n",
"min NaN 2014.000000 1.000000 NaN 27.000000 3.000000 \n",
"25% NaN 2015.000000 5.000000 NaN 34.000000 9.000000 \n",
"50% NaN 2016.000000 10.000000 NaN 38.000000 13.000000 \n",
"75% NaN 2018.000000 14.250000 NaN 38.000000 18.000000 \n",
"max NaN 2019.000000 20.000000 NaN 38.000000 32.000000 \n",
"\n",
" 8 27 27.1 76 ... \\\n",
"count 136.000000 136.000000 136.000000 136.000000 ... \n",
"unique NaN NaN NaN NaN ... \n",
"top NaN NaN NaN NaN ... \n",
"freq NaN NaN NaN NaN ... \n",
"mean 9.235294 12.985294 49.992647 47.161765 ... \n",
"std 2.982009 5.458239 19.156469 12.035885 ... \n",
"min 2.000000 1.000000 22.000000 17.000000 ... \n",
"25% 8.000000 10.000000 36.000000 39.750000 ... \n",
"50% 9.000000 13.500000 44.500000 48.000000 ... \n",
"75% 11.000000 17.000000 59.000000 55.000000 ... \n",
"max 18.000000 27.000000 107.000000 78.000000 ... \n",
"\n",
" 59.009572999999996 -16.990427000000004 55.203728000000005 \\\n",
"count 136.000000 136.000000 136.000000 \n",
"unique NaN NaN NaN \n",
"top NaN NaN NaN \n",
"freq NaN NaN NaN \n",
"mean 45.649438 -1.512327 41.882987 \n",
"std 10.421890 6.119189 9.769518 \n",
"min 16.838674 -15.126091 16.084399 \n",
"25% 38.312105 -5.828530 35.044259 \n",
"50% 45.576085 -1.550316 41.725086 \n",
"75% 51.834812 3.352319 48.188921 \n",
"max 72.709620 11.943205 66.619420 \n",
"\n",
" -30.199010599999994 13.835949475203492 7.984215614090003 \\\n",
"count 136.000000 136.000000 136.000000 \n",
"unique NaN NaN NaN \n",
"top NaN NaN NaN \n",
"freq NaN NaN NaN \n",
"mean 2.751728 10.485561 11.226170 \n",
"std 19.764675 2.525851 3.898035 \n",
"min -38.185295 6.404365 5.579031 \n",
"25% -10.859336 8.502879 8.652774 \n",
"50% -1.475171 10.096481 10.718674 \n",
"75% 11.734464 11.948190 12.374883 \n",
"max 58.818903 19.517768 26.967792 \n",
"\n",
" 136 300 29.814 12.814 \n",
"count 136.000000 136.000000 136.000000 136.000000 \n",
"unique NaN NaN NaN NaN \n",
"top NaN NaN NaN NaN \n",
"freq NaN NaN NaN NaN \n",
"mean 217.455882 199.213235 51.969418 0.623829 \n",
"std 87.269176 53.453255 13.772017 7.601079 \n",
"min 82.000000 87.000000 25.071500 -24.721600 \n",
"25% 157.750000 164.000000 42.223750 -4.768925 \n",
"50% 197.000000 191.500000 50.442600 1.283950 \n",
"75% 242.250000 225.250000 59.790125 6.092850 \n",
"max 547.000000 364.000000 86.756400 20.158700 \n",
"\n",
"[11 rows x 24 columns]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"understat_test.describe(include='all')"
]
},
{
"cell_type": "markdown",
"id": "4e0dcbbd",
"metadata": {},
"source": [
"4. Normalizacja - dane sa znormalizowane (nie moge ingerowac w parametry ktore sa danymi do obliczania innych parametrow)"
]
},
{
"cell_type": "markdown",
"id": "1ea021db",
"metadata": {},
"source": [
"5. Wyczyszczenie z artefaktow "
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "99805022",
"metadata": {},
"outputs": [],
"source": [
"! grep -P \"^$\" -n understat.csv #brak pustych linijek"
]
}
],
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}