Profile picture

Data Scientist @ RMOTR

FIFA Dataset

Last updated: October 9th, 20192019-10-09Project preview
In [1]:
import pandas as pd
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
pd.set_option('display.max_colwidth', 1000)
pd.set_option('display.float_format', '{:,.3f}'.format)

%matplotlib inline
In [2]:
flatui = ["#2e86de", "#ff4757", "#feca57", "#2ed573", "#ff7f50", "#00cec9", "#fd79a8", "#a4b0be"]
flatui_palette = sns.color_palette(flatui)
sns.palplot(flatui_palette)
sns.set_palette(flatui_palette)
sns.palplot(sns.light_palette(flatui_palette[0]))
sns.palplot(sns.light_palette(flatui_palette[1]))
sns.palplot(sns.light_palette(flatui_palette[3]))

sns.set_style("darkgrid", {
    'axes.edgecolor': '#2b2b2b',
    'axes.facecolor': '#2b2b2b',
    'axes.labelcolor': '#919191',
    'figure.facecolor': '#2b2b2b',
    'grid.color': '#545454',
    'patch.edgecolor': '#2b2b2b',
    'text.color': '#bababa',
    'xtick.color': '#bababa',
    'ytick.color': '#bababa',
})
In [3]:
df = pd.read_csv('data/data.csv')
print(df.shape)

df.head()
(18207, 89)
Out[3]:
Unnamed: 0 ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause
0 0 158023 L. Messi 31 https://cdn.sofifa.org/players/4/19/158023.png Argentina https://cdn.sofifa.org/flags/52.png 94 94 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png €110.5M €565K 2202 Left 5.000 4.000 4.000 Medium/ Medium Messi Yes RF 10.000 Jul 1, 2004 NaN 2021 5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2 93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2 47+2 47+2 59+2 84.000 95.000 70.000 90.000 86.000 97.000 93.000 94.000 87.000 96.000 91.000 86.000 91.000 95.000 95.000 85.000 68.000 72.000 59.000 94.000 48.000 22.000 94.000 94.000 75.000 96.000 33.000 28.000 26.000 6.000 11.000 15.000 14.000 8.000 €226.5M
1 1 20801 Cristiano Ronaldo 33 https://cdn.sofifa.org/players/4/19/20801.png Portugal https://cdn.sofifa.org/flags/38.png 94 94 Juventus https://cdn.sofifa.org/teams/2/light/45.png €77M €405K 2228 Right 5.000 4.000 5.000 High/ Low C. Ronaldo Yes ST 7.000 Jul 10, 2018 NaN 2022 6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3 88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3 53+3 53+3 61+3 84.000 94.000 89.000 81.000 87.000 88.000 81.000 76.000 77.000 94.000 89.000 91.000 87.000 96.000 70.000 95.000 95.000 88.000 79.000 93.000 63.000 29.000 95.000 82.000 85.000 95.000 28.000 31.000 23.000 7.000 11.000 15.000 14.000 11.000 €127.1M
2 2 190871 Neymar Jr 26 https://cdn.sofifa.org/players/4/19/190871.png Brazil https://cdn.sofifa.org/flags/54.png 92 93 Paris Saint-Germain https://cdn.sofifa.org/teams/2/light/73.png €118.5M €290K 2143 Right 5.000 5.000 5.000 High/ Medium Neymar Yes LW 10.000 Aug 3, 2017 NaN 2022 5'9 150lbs 84+3 84+3 84+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 88+3 81+3 81+3 81+3 88+3 65+3 60+3 60+3 60+3 65+3 60+3 47+3 47+3 47+3 60+3 79.000 87.000 62.000 84.000 84.000 96.000 88.000 87.000 78.000 95.000 94.000 90.000 96.000 94.000 84.000 80.000 61.000 81.000 49.000 82.000 56.000 36.000 89.000 87.000 81.000 94.000 27.000 24.000 33.000 9.000 9.000 15.000 15.000 11.000 €228.1M
3 3 193080 De Gea 27 https://cdn.sofifa.org/players/4/19/193080.png Spain https://cdn.sofifa.org/flags/45.png 91 93 Manchester United https://cdn.sofifa.org/teams/2/light/11.png €72M €260K 1471 Right 4.000 3.000 1.000 Medium/ Medium Lean Yes GK 1.000 Jul 1, 2011 NaN 2020 6'4 168lbs NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 17.000 13.000 21.000 50.000 13.000 18.000 21.000 19.000 51.000 42.000 57.000 58.000 60.000 90.000 43.000 31.000 67.000 43.000 64.000 12.000 38.000 30.000 12.000 68.000 40.000 68.000 15.000 21.000 13.000 90.000 85.000 87.000 88.000 94.000 €138.6M
4 4 192985 K. De Bruyne 27 https://cdn.sofifa.org/players/4/19/192985.png Belgium https://cdn.sofifa.org/flags/7.png 91 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png €102M €355K 2281 Right 4.000 5.000 4.000 High/ High Normal Yes RCM 7.000 Aug 30, 2015 NaN 2023 5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3 88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3 66+3 66+3 73+3 93.000 82.000 55.000 92.000 82.000 86.000 85.000 83.000 91.000 91.000 78.000 76.000 79.000 91.000 77.000 91.000 63.000 90.000 75.000 91.000 76.000 61.000 87.000 94.000 79.000 88.000 68.000 58.000 51.000 15.000 13.000 5.000 10.000 13.000 €196.4M
In [4]:
df['Potential'].min()
Out[4]:
48
In [5]:
df['Potential'].max()
Out[5]:
95
In [6]:
df['Potential'].describe()
Out[6]:
count   18,207.000
mean        71.307
std          6.136
min         48.000
25%         67.000
50%         71.000
75%         75.000
max         95.000
Name: Potential, dtype: float64
In [7]:
df.drop(['Unnamed: 0'], axis=1, inplace=True)

df.head()
Out[7]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause
0 158023 L. Messi 31 https://cdn.sofifa.org/players/4/19/158023.png Argentina https://cdn.sofifa.org/flags/52.png 94 94 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png €110.5M €565K 2202 Left 5.000 4.000 4.000 Medium/ Medium Messi Yes RF 10.000 Jul 1, 2004 NaN 2021 5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2 93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2 47+2 47+2 59+2 84.000 95.000 70.000 90.000 86.000 97.000 93.000 94.000 87.000 96.000 91.000 86.000 91.000 95.000 95.000 85.000 68.000 72.000 59.000 94.000 48.000 22.000 94.000 94.000 75.000 96.000 33.000 28.000 26.000 6.000 11.000 15.000 14.000 8.000 €226.5M
1 20801 Cristiano Ronaldo 33 https://cdn.sofifa.org/players/4/19/20801.png Portugal https://cdn.sofifa.org/flags/38.png 94 94 Juventus https://cdn.sofifa.org/teams/2/light/45.png €77M €405K 2228 Right 5.000 4.000 5.000 High/ Low C. Ronaldo Yes ST 7.000 Jul 10, 2018 NaN 2022 6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3 88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3 53+3 53+3 61+3 84.000 94.000 89.000 81.000 87.000 88.000 81.000 76.000 77.000 94.000 89.000 91.000 87.000 96.000 70.000 95.000 95.000 88.000 79.000 93.000 63.000 29.000 95.000 82.000 85.000 95.000 28.000 31.000 23.000 7.000 11.000 15.000 14.000 11.000 €127.1M
2 190871 Neymar Jr 26 https://cdn.sofifa.org/players/4/19/190871.png Brazil https://cdn.sofifa.org/flags/54.png 92 93 Paris Saint-Germain https://cdn.sofifa.org/teams/2/light/73.png €118.5M €290K 2143 Right 5.000 5.000 5.000 High/ Medium Neymar Yes LW 10.000 Aug 3, 2017 NaN 2022 5'9 150lbs 84+3 84+3 84+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 88+3 81+3 81+3 81+3 88+3 65+3 60+3 60+3 60+3 65+3 60+3 47+3 47+3 47+3 60+3 79.000 87.000 62.000 84.000 84.000 96.000 88.000 87.000 78.000 95.000 94.000 90.000 96.000 94.000 84.000 80.000 61.000 81.000 49.000 82.000 56.000 36.000 89.000 87.000 81.000 94.000 27.000 24.000 33.000 9.000 9.000 15.000 15.000 11.000 €228.1M
3 193080 De Gea 27 https://cdn.sofifa.org/players/4/19/193080.png Spain https://cdn.sofifa.org/flags/45.png 91 93 Manchester United https://cdn.sofifa.org/teams/2/light/11.png €72M €260K 1471 Right 4.000 3.000 1.000 Medium/ Medium Lean Yes GK 1.000 Jul 1, 2011 NaN 2020 6'4 168lbs NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 17.000 13.000 21.000 50.000 13.000 18.000 21.000 19.000 51.000 42.000 57.000 58.000 60.000 90.000 43.000 31.000 67.000 43.000 64.000 12.000 38.000 30.000 12.000 68.000 40.000 68.000 15.000 21.000 13.000 90.000 85.000 87.000 88.000 94.000 €138.6M
4 192985 K. De Bruyne 27 https://cdn.sofifa.org/players/4/19/192985.png Belgium https://cdn.sofifa.org/flags/7.png 91 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png €102M €355K 2281 Right 4.000 5.000 4.000 High/ High Normal Yes RCM 7.000 Aug 30, 2015 NaN 2023 5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3 88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3 66+3 66+3 73+3 93.000 82.000 55.000 92.000 82.000 86.000 85.000 83.000 91.000 91.000 78.000 76.000 79.000 91.000 77.000 91.000 63.000 90.000 75.000 91.000 76.000 61.000 87.000 94.000 79.000 88.000 68.000 58.000 51.000 15.000 13.000 5.000 10.000 13.000 €196.4M

Parse value as numeric:

In [8]:
df['Value'].head()
Out[8]:
0    €110.5M
1       €77M
2    €118.5M
3       €72M
4      €102M
Name: Value, dtype: object
In [9]:
df['Value Multiplier'] = 1
df.loc[df['Value'].str.contains('K'), 'Value Multiplier'] = 1_000
df.loc[df['Value'].str.contains('M'), 'Value Multiplier'] = 1_000_000
In [10]:
df['Value'] = df['Value'].str.replace('M', '').str.replace('K', '').str.replace('€', '')
df['Value'].head()
Out[10]:
0    110.5
1       77
2    118.5
3       72
4      102
Name: Value, dtype: object
In [11]:
df['Value Number'] = pd.to_numeric(df['Value']) * df['Value Multiplier']
df['Value Number'].head()
Out[11]:
0   110,500,000.000
1    77,000,000.000
2   118,500,000.000
3    72,000,000.000
4   102,000,000.000
Name: Value Number, dtype: float64
In [12]:
fig, ax = plt.subplots(figsize=(16, 6))

sns.distplot(df['Value Number'])

plt.title("Value", fontsize=16, fontweight='bold', color='white')
Out[12]:
Text(0.5,1,'Value')

Parse Wages:

In [13]:
df['Wage'].head()
Out[13]:
0    €565K
1    €405K
2    €290K
3    €260K
4    €355K
Name: Wage, dtype: object
In [14]:
df['Wage Multiplier'] = 1
df.loc[df['Wage'].str.contains('K'), 'Wage Multiplier'] = 1_000
df.loc[df['Wage'].str.contains('M'), 'Wage Multiplier'] = 1_000_000
In [15]:
df['Wage'] = df['Wage'].str.replace('M', '').str.replace('K', '').str.replace('€', '')
df['Wage'].head()
Out[15]:
0    565
1    405
2    290
3    260
4    355
Name: Wage, dtype: object
In [16]:
df['Wage Number'] = pd.to_numeric(df['Wage']) * df['Wage Multiplier']
df['Wage Number'].head()
Out[16]:
0    565000
1    405000
2    290000
3    260000
4    355000
Name: Wage Number, dtype: int64
In [17]:
fig, ax = plt.subplots(figsize=(16, 6))

sns.distplot(df['Wage Number'])

plt.title("Wage", fontsize=16, fontweight='bold', color='white')
Out[17]:
Text(0.5,1,'Wage')
In [18]:
df[['Value Number', 'Wage Number']].isna().sum()
Out[18]:
Value Number    0
Wage Number     0
dtype: int64
In [19]:
(df['Value Number'] / df['Wage Number']).isna().sum()
Out[19]:
241
In [20]:
fig, ax = plt.subplots(figsize=(16, 6))

sns.distplot((df['Value Number'] / df['Wage Number']).dropna().sort_values(ascending=False).head(20))

plt.title("Value vs Wage", fontsize=16, fontweight='bold', color='white')
Out[20]:
Text(0.5,1,'Value vs Wage')
In [21]:
fig, ax = plt.subplots(figsize=(16, 8))

value_wage = df.loc[df['Value Number'] > 0]
value_cond = df.loc[df['Value Number'] > 63_000_000]

sns.regplot('Value Number', 'Wage Number',
            data=value_wage)

for i in value_cond.index:
    ax.annotate(value_cond.loc[i, 'Name'], (value_cond.loc[i, 'Value Number'], value_cond.loc[i, 'Wage Number']),
                rotation=-15)

plt.title("Value vs Wage", fontsize=16, fontweight='bold', color='white')
Out[21]:
Text(0.5,1,'Value vs Wage')
In [22]:
df.head()
Out[22]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause Value Multiplier Value Number Wage Multiplier Wage Number
0 158023 L. Messi 31 https://cdn.sofifa.org/players/4/19/158023.png Argentina https://cdn.sofifa.org/flags/52.png 94 94 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png 110.5 565 2202 Left 5.000 4.000 4.000 Medium/ Medium Messi Yes RF 10.000 Jul 1, 2004 NaN 2021 5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2 93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2 47+2 47+2 59+2 84.000 95.000 70.000 90.000 86.000 97.000 93.000 94.000 87.000 96.000 91.000 86.000 91.000 95.000 95.000 85.000 68.000 72.000 59.000 94.000 48.000 22.000 94.000 94.000 75.000 96.000 33.000 28.000 26.000 6.000 11.000 15.000 14.000 8.000 €226.5M 1000000 110,500,000.000 1000 565000
1 20801 Cristiano Ronaldo 33 https://cdn.sofifa.org/players/4/19/20801.png Portugal https://cdn.sofifa.org/flags/38.png 94 94 Juventus https://cdn.sofifa.org/teams/2/light/45.png 77 405 2228 Right 5.000 4.000 5.000 High/ Low C. Ronaldo Yes ST 7.000 Jul 10, 2018 NaN 2022 6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3 88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3 53+3 53+3 61+3 84.000 94.000 89.000 81.000 87.000 88.000 81.000 76.000 77.000 94.000 89.000 91.000 87.000 96.000 70.000 95.000 95.000 88.000 79.000 93.000 63.000 29.000 95.000 82.000 85.000 95.000 28.000 31.000 23.000 7.000 11.000 15.000 14.000 11.000 €127.1M 1000000 77,000,000.000 1000 405000
2 190871 Neymar Jr 26 https://cdn.sofifa.org/players/4/19/190871.png Brazil https://cdn.sofifa.org/flags/54.png 92 93 Paris Saint-Germain https://cdn.sofifa.org/teams/2/light/73.png 118.5 290 2143 Right 5.000 5.000 5.000 High/ Medium Neymar Yes LW 10.000 Aug 3, 2017 NaN 2022 5'9 150lbs 84+3 84+3 84+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 89+3 88+3 81+3 81+3 81+3 88+3 65+3 60+3 60+3 60+3 65+3 60+3 47+3 47+3 47+3 60+3 79.000 87.000 62.000 84.000 84.000 96.000 88.000 87.000 78.000 95.000 94.000 90.000 96.000 94.000 84.000 80.000 61.000 81.000 49.000 82.000 56.000 36.000 89.000 87.000 81.000 94.000 27.000 24.000 33.000 9.000 9.000 15.000 15.000 11.000 €228.1M 1000000 118,500,000.000 1000 290000
3 193080 De Gea 27 https://cdn.sofifa.org/players/4/19/193080.png Spain https://cdn.sofifa.org/flags/45.png 91 93 Manchester United https://cdn.sofifa.org/teams/2/light/11.png 72 260 1471 Right 4.000 3.000 1.000 Medium/ Medium Lean Yes GK 1.000 Jul 1, 2011 NaN 2020 6'4 168lbs NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 17.000 13.000 21.000 50.000 13.000 18.000 21.000 19.000 51.000 42.000 57.000 58.000 60.000 90.000 43.000 31.000 67.000 43.000 64.000 12.000 38.000 30.000 12.000 68.000 40.000 68.000 15.000 21.000 13.000 90.000 85.000 87.000 88.000 94.000 €138.6M 1000000 72,000,000.000 1000 260000
4 192985 K. De Bruyne 27 https://cdn.sofifa.org/players/4/19/192985.png Belgium https://cdn.sofifa.org/flags/7.png 91 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png 102 355 2281 Right 4.000 5.000 4.000 High/ High Normal Yes RCM 7.000 Aug 30, 2015 NaN 2023 5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3 88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3 66+3 66+3 73+3 93.000 82.000 55.000 92.000 82.000 86.000 85.000 83.000 91.000 91.000 78.000 76.000 79.000 91.000 77.000 91.000 63.000 90.000 75.000 91.000 76.000 61.000 87.000 94.000 79.000 88.000 68.000 58.000 51.000 15.000 13.000 5.000 10.000 13.000 €196.4M 1000000 102,000,000.000 1000 355000
In [23]:
df['Value to Wage'] = (df['Value Number'] / df['Wage Number'])
In [24]:
df.sort_values(by='Value to Wage', ascending=False).head(20)
Out[24]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause Value Multiplier Value Number Wage Multiplier Wage Number Value to Wage
286 188803 Taison 30 https://cdn.sofifa.org/players/4/19/188803.png Brazil https://cdn.sofifa.org/flags/54.png 82 82 Shakhtar Donetsk https://cdn.sofifa.org/teams/2/light/101059.png 21 1 2055 Right 2.000 3.000 4.000 Medium/ Medium Lean No LM 7.000 Jan 11, 2013 NaN 2021 5'8 141lbs 77+2 77+2 77+2 81+2 81+2 81+2 81+2 81+2 81+2 81+2 81+2 81+2 76+2 76+2 76+2 81+2 67+2 64+2 64+2 64+2 67+2 64+2 55+2 55+2 55+2 64+2 73.000 76.000 56.000 77.000 82.000 87.000 52.000 73.000 75.000 85.000 93.000 91.000 90.000 79.000 83.000 83.000 62.000 79.000 62.000 83.000 56.000 49.000 74.000 79.000 72.000 74.000 38.000 53.000 40.000 7.000 7.000 11.000 15.000 13.000 €44.1M 1000000 21,000,000.000 1000 1000 21,000.000
288 187754 Marlos 30 https://cdn.sofifa.org/players/4/19/187754.png Ukraine https://cdn.sofifa.org/flags/49.png 82 82 Shakhtar Donetsk https://cdn.sofifa.org/teams/2/light/101059.png 21 1 2075 Left 2.000 4.000 5.000 Medium/ Medium Normal No RM 11.000 Jul 4, 2014 NaN 2019 5'9 152lbs 76+2 76+2 76+2 82+2 81+2 81+2 81+2 82+2 82+2 82+2 82+2 81+2 77+2 77+2 77+2 81+2 67+2 65+2 65+2 65+2 67+2 64+2 56+2 56+2 56+2 64+2 76.000 79.000 53.000 81.000 68.000 87.000 82.000 72.000 73.000 88.000 85.000 82.000 92.000 77.000 84.000 77.000 68.000 78.000 62.000 78.000 58.000 51.000 77.000 82.000 80.000 84.000 45.000 49.000 42.000 6.000 13.000 13.000 8.000 9.000 €44.1M 1000000 21,000,000.000 1000 1000 21,000.000
381 187491 F. Smolov 28 https://cdn.sofifa.org/players/4/19/187491.png Russia https://cdn.sofifa.org/flags/40.png 81 81 Lokomotiv Moscow https://cdn.sofifa.org/teams/2/light/100765.png 18.5 1 1971 Right 1.000 4.000 4.000 High/ Medium Lean No ST 11.000 Aug 9, 2018 NaN 2022 6'2 176lbs 79+2 79+2 79+2 77+2 79+2 79+2 79+2 77+2 78+2 78+2 78+2 76+2 70+2 70+2 70+2 76+2 56+2 55+2 55+2 55+2 56+2 53+2 48+2 48+2 48+2 53+2 56.000 84.000 70.000 77.000 79.000 77.000 78.000 69.000 62.000 78.000 88.000 85.000 75.000 74.000 66.000 80.000 67.000 74.000 75.000 81.000 67.000 32.000 84.000 75.000 74.000 73.000 26.000 28.000 24.000 16.000 9.000 16.000 15.000 10.000 €38.9M 1000000 18,500,000.000 1000 1000 18,500.000
276 193525 Mário Fernandes 27 https://cdn.sofifa.org/players/4/19/193525.png Russia https://cdn.sofifa.org/flags/40.png 82 82 PFC CSKA Moscow https://cdn.sofifa.org/teams/2/light/315.png 18.5 1 2102 Right 2.000 3.000 3.000 High/ High Lean No RB 6.000 Jul 1, 2012 NaN 2022 6'2 176lbs 72+2 72+2 72+2 74+2 74+2 74+2 74+2 74+2 74+2 74+2 74+2 76+2 76+2 76+2 76+2 76+2 80+2 79+2 79+2 79+2 80+2 80+2 79+2 79+2 79+2 80+2 76.000 56.000 76.000 78.000 52.000 77.000 66.000 39.000 74.000 79.000 79.000 85.000 79.000 80.000 61.000 71.000 84.000 87.000 75.000 58.000 77.000 78.000 76.000 73.000 53.000 76.000 83.000 82.000 84.000 12.000 13.000 14.000 13.000 12.000 €40.7M 1000000 18,500,000.000 1000 1000 18,500.000
555 244369 V. Tsygankov 20 https://cdn.sofifa.org/players/4/19/244369.png Ukraine https://cdn.sofifa.org/flags/49.png 79 86 Dynamo Kyiv https://cdn.sofifa.org/teams/2/light/101047.png 18 1 1919 Left 1.000 4.000 4.000 High/ Medium Lean No RM 15.000 Jan 1, 2015 NaN 2023 5'10 152lbs 71+2 71+2 71+2 78+2 77+2 77+2 77+2 78+2 78+2 78+2 78+2 78+2 73+2 73+2 73+2 78+2 64+2 61+2 61+2 61+2 64+2 61+2 51+2 51+2 51+2 61+2 76.000 75.000 45.000 80.000 68.000 80.000 68.000 71.000 69.000 81.000 82.000 83.000 77.000 78.000 73.000 70.000 50.000 74.000 47.000 72.000 57.000 39.000 75.000 80.000 61.000 79.000 66.000 36.000 37.000 9.000 7.000 15.000 6.000 12.000 €41.4M 1000000 18,000,000.000 1000 1000 18,000.000
574 225997 B. Verbič 24 https://cdn.sofifa.org/players/4/19/225997.png Slovenia https://cdn.sofifa.org/flags/44.png 79 81 Dynamo Kyiv https://cdn.sofifa.org/teams/2/light/101047.png 15.5 1 1978 Right 1.000 3.000 4.000 High/ Medium Normal No LM 21.000 Jan 1, 2018 NaN 2023 5'10 154lbs 75+2 75+2 75+2 77+2 77+2 77+2 77+2 77+2 77+2 77+2 77+2 77+2 71+2 71+2 71+2 77+2 61+2 60+2 60+2 60+2 61+2 58+2 54+2 54+2 54+2 58+2 70.000 74.000 65.000 75.000 68.000 81.000 63.000 65.000 69.000 80.000 85.000 81.000 78.000 79.000 81.000 70.000 72.000 77.000 72.000 71.000 74.000 32.000 80.000 75.000 63.000 76.000 54.000 34.000 33.000 15.000 11.000 13.000 6.000 12.000 €33.7M 1000000 15,500,000.000 1000 1000 15,500.000
597 213160 R. Zobnin 24 https://cdn.sofifa.org/players/4/19/213160.png Russia https://cdn.sofifa.org/flags/40.png 79 86 Spartak Moscow https://cdn.sofifa.org/teams/2/light/100767.png 15 1 2056 Right 1.000 3.000 4.000 High/ High Lean No LDM 8.000 Jul 1, 2016 NaN 2021 6'0 165lbs 70+2 70+2 70+2 74+2 74+2 74+2 74+2 74+2 75+2 75+2 75+2 76+2 77+2 77+2 77+2 76+2 78+2 78+2 78+2 78+2 78+2 77+2 75+2 75+2 75+2 77+2 69.000 65.000 70.000 81.000 55.000 82.000 65.000 65.000 79.000 82.000 74.000 78.000 70.000 79.000 65.000 65.000 63.000 90.000 63.000 67.000 70.000 75.000 64.000 72.000 57.000 77.000 81.000 79.000 76.000 10.000 8.000 13.000 15.000 9.000 €34.5M 1000000 15,000,000.000 1000 1000 15,000.000
621 203757 Zé Luís 27 https://cdn.sofifa.org/players/4/19/203757.png Cape Verde https://cdn.sofifa.org/flags/104.png 79 80 Spartak Moscow https://cdn.sofifa.org/teams/2/light/100767.png 14.5 1 1892 Left 1.000 4.000 4.000 Medium/ Medium Normal No ST 9.000 Jul 7, 2015 NaN 2021 6'0 194lbs 77+2 77+2 77+2 73+2 77+2 77+2 77+2 73+2 74+2 74+2 74+2 71+2 65+2 65+2 65+2 71+2 53+2 52+2 52+2 52+2 53+2 51+2 51+2 51+2 51+2 51+2 45.000 74.000 83.000 67.000 75.000 80.000 66.000 54.000 44.000 81.000 80.000 81.000 64.000 80.000 61.000 79.000 92.000 68.000 83.000 64.000 76.000 29.000 78.000 75.000 75.000 72.000 36.000 19.000 24.000 8.000 11.000 16.000 10.000 14.000 €31.5M 1000000 14,500,000.000 1000 1000 14,500.000
748 226766 Daniel Podence 22 https://cdn.sofifa.org/players/4/19/226766.png Portugal https://cdn.sofifa.org/flags/38.png 78 84 Olympiacos CFP https://cdn.sofifa.org/teams/2/light/280.png 14 1 1848 Right 1.000 4.000 4.000 High/ Medium Normal No LM 56.000 Jul 10, 2018 NaN 2023 5'4 143lbs 68+2 68+2 68+2 77+2 76+2 76+2 76+2 77+2 77+2 77+2 77+2 77+2 69+2 69+2 69+2 77+2 58+2 54+2 54+2 54+2 58+2 54+2 43+2 43+2 43+2 54+2 63.000 64.000 42.000 74.000 57.000 84.000 75.000 42.000 66.000 81.000 94.000 92.000 92.000 77.000 94.000 65.000 66.000 72.000 30.000 55.000 67.000 21.000 76.000 77.000 63.000 78.000 42.000 30.000 29.000 14.000 14.000 8.000 7.000 15.000 €33.6M 1000000 14,000,000.000 1000 1000 14,000.000
405 157960 Manuel Fernandes 32 https://cdn.sofifa.org/players/4/19/157960.png Portugal https://cdn.sofifa.org/flags/38.png 81 81 Lokomotiv Moscow https://cdn.sofifa.org/teams/2/light/100765.png 14 1 2157 Right 2.000 4.000 4.000 High/ Medium Normal No LM 4.000 Jul 1, 2014 NaN 2019 5'9 165lbs 75+2 75+2 75+2 79+2 78+2 78+2 78+2 79+2 80+2 80+2 80+2 79+2 78+2 78+2 78+2 79+2 74+2 73+2 73+2 73+2 74+2 72+2 68+2 68+2 68+2 72+2 79.000 70.000 59.000 80.000 69.000 86.000 79.000 70.000 80.000 83.000 83.000 76.000 82.000 76.000 76.000 81.000 74.000 76.000 71.000 82.000 68.000 68.000 75.000 81.000 73.000 77.000 62.000 69.000 68.000 14.000 14.000 9.000 16.000 8.000 €29.4M 1000000 14,000,000.000 1000 1000 14,000.000
386 179784 B. Höwedes 30 https://cdn.sofifa.org/players/4/19/179784.png Germany https://cdn.sofifa.org/flags/21.png 81 81 Lokomotiv Moscow https://cdn.sofifa.org/teams/2/light/100765.png 13 1 1813 Right 3.000 3.000 2.000 Medium/ Medium Normal Yes RCB 5.000 Jul 31, 2018 NaN 2022 6'2 170lbs 60+3 60+3 60+3 58+3 59+3 59+3 59+3 58+3 60+3 60+3 60+3 60+3 64+3 64+3 64+3 60+3 70+3 74+3 74+3 74+3 70+3 72+3 79+3 79+3 79+3 72+3 58.000 51.000 83.000 72.000 45.000 59.000 38.000 52.000 64.000 65.000 52.000 52.000 60.000 81.000 61.000 57.000 78.000 61.000 78.000 31.000 78.000 81.000 51.000 57.000 56.000 84.000 82.000 83.000 81.000 14.000 6.000 9.000 10.000 7.000 €27.3M 1000000 13,000,000.000 1000 1000 13,000.000
301 181786 V. Ćorluka 32 https://cdn.sofifa.org/players/4/19/181786.png Croatia https://cdn.sofifa.org/flags/10.png 82 82 Lokomotiv Moscow https://cdn.sofifa.org/teams/2/light/100765.png 12.5 1 1909 Right 3.000 3.000 3.000 High/ Medium Normal No LCB 14.000 Jun 27, 2012 NaN 2020 6'4 185lbs 61+3 61+3 61+3 61+3 61+3 61+3 61+3 61+3 62+3 62+3 62+3 64+3 68+3 68+3 68+3 64+3 74+3 76+3 76+3 76+3 74+3 75+3 79+3 79+3 79+3 75+3 68.000 44.000 83.000 70.000 38.000 65.000 69.000 60.000 72.000 73.000 49.000 65.000 57.000 77.000 46.000 64.000 81.000 80.000 86.000 50.000 81.000 77.000 45.000 60.000 49.000 78.000 79.000 83.000 82.000 15.000 9.000 12.000 14.000 6.000 €26.3M 1000000 12,500,000.000 1000 1000 12,500.000
676 187735 A. Dzagoev 28 https://cdn.sofifa.org/players/4/19/187735.png Russia https://cdn.sofifa.org/flags/40.png 79 79 PFC CSKA Moscow https://cdn.sofifa.org/teams/2/light/315.png 12.5 1 2115 Right 3.000 3.000 4.000 High/ Medium Normal Yes RDM 10.000 Jan 1, 2008 NaN 2019 5'10 165lbs 74+3 74+3 74+3 76+3 76+3 76+3 76+3 76+3 77+3 77+3 77+3 77+3 77+3 77+3 77+3 77+3 74+3 74+3 74+3 74+3 74+3 73+3 70+3 70+3 70+3 73+3 75.000 70.000 67.000 79.000 72.000 78.000 74.000 75.000 76.000 81.000 81.000 69.000 71.000 80.000 72.000 76.000 73.000 74.000 66.000 71.000 69.000 71.000 76.000 81.000 65.000 78.000 69.000 71.000 70.000 11.000 16.000 12.000 14.000 10.000 €27.5M 1000000 12,500,000.000 1000 1000 12,500.000
484 195861 Y. Rakitskyi 28 https://cdn.sofifa.org/players/4/19/195861.png Ukraine https://cdn.sofifa.org/flags/49.png 80 80 Shakhtar Donetsk https://cdn.sofifa.org/teams/2/light/101059.png 12 1 2113 Left 2.000 3.000 3.000 High/ Medium Normal No LCB 44.000 Aug 1, 2009 NaN 2022 6'1 183lbs 69+2 69+2 69+2 69+2 69+2 69+2 69+2 69+2 71+2 71+2 71+2 70+2 75+2 75+2 75+2 70+2 76+2 79+2 79+2 79+2 76+2 77+2 79+2 79+2 79+2 77+2 68.000 57.000 69.000 78.000 53.000 69.000 75.000 77.000 84.000 73.000 69.000 72.000 68.000 76.000 73.000 87.000 74.000 82.000 84.000 86.000 84.000 82.000 53.000 75.000 50.000 78.000 78.000 83.000 81.000 12.000 16.000 7.000 12.000 6.000 €25.2M 1000000 12,000,000.000 1000 1000 12,000.000
986 214092 A. Miranchuk 22 https://cdn.sofifa.org/players/4/19/214092.png Russia https://cdn.sofifa.org/flags/40.png 77 82 Lokomotiv Moscow https://cdn.sofifa.org/teams/2/light/100765.png 12 1 1780 Left 1.000 2.000 3.000 Medium/ Medium Lean No CAM 15.000 Jul 1, 2012 NaN 2021 6'0 163lbs 69+2 69+2 69+2 74+2 73+2 73+2 73+2 74+2 75+2 75+2 75+2 74+2 71+2 71+2 71+2 74+2 57+2 55+2 55+2 55+2 57+2 53+2 44+2 44+2 44+2 53+2 65.000 64.000 53.000 82.000 62.000 78.000 64.000 53.000 71.000 79.000 71.000 75.000 77.000 74.000 67.000 65.000 58.000 74.000 64.000 65.000 43.000 36.000 72.000 80.000 57.000 70.000 22.000 28.000 29.000 8.000 8.000 9.000 12.000 15.000 €26.1M 1000000 12,000,000.000 1000 1000 12,000.000
453 206413 T. Stepanenko 28 https://cdn.sofifa.org/players/4/19/206413.png Ukraine https://cdn.sofifa.org/flags/49.png 80 80 Shakhtar Donetsk https://cdn.sofifa.org/teams/2/light/101059.png 12 1 2006 Left 1.000 3.000 3.000 Medium/ High Normal No RDM 6.000 Jul 1, 2010 NaN 2022 5'11 168lbs 66+2 66+2 66+2 67+2 68+2 68+2 68+2 67+2 69+2 69+2 69+2 69+2 74+2 74+2 74+2 69+2 75+2 79+2 79+2 79+2 75+2 76+2 77+2 77+2 77+2 76+2 63.000 53.000 69.000 81.000 56.000 64.000 60.000 45.000 77.000 78.000 71.000 64.000 60.000 78.000 73.000 75.000 71.000 82.000 76.000 70.000 88.000 82.000 54.000 69.000 52.000 81.000 79.000 79.000 77.000 15.000 13.000 9.000 14.000 9.000 €25.2M 1000000 12,000,000.000 1000 1000 12,000.000
473 201119 Ismaily 28 https://cdn.sofifa.org/players/4/19/201119.png Brazil https://cdn.sofifa.org/flags/54.png 80 80 Shakhtar Donetsk https://cdn.sofifa.org/teams/2/light/101059.png 11.5 1 2073 Left 1.000 2.000 4.000 High/ High Stocky No LB 31.000 Feb 14, 2013 NaN 2023 5'10 181lbs 73+2 73+2 73+2 78+2 77+2 77+2 77+2 78+2 77+2 77+2 77+2 79+2 77+2 77+2 77+2 79+2 79+2 76+2 76+2 76+2 79+2 78+2 73+2 73+2 73+2 78+2 80.000 60.000 59.000 81.000 55.000 83.000 65.000 50.000 67.000 81.000 84.000 80.000 72.000 81.000 82.000 75.000 59.000 88.000 75.000 73.000 63.000 79.000 82.000 71.000 51.000 79.000 77.000 74.000 75.000 8.000 8.000 14.000 11.000 10.000 €24.2M 1000000 11,500,000.000 1000 1000 11,500.000
1146 203980 K. Fortounis 25 https://cdn.sofifa.org/players/4/19/203980.png Greece https://cdn.sofifa.org/flags/22.png 77 80 Olympiacos CFP https://cdn.sofifa.org/teams/2/light/280.png 11 1 1971 Right 2.000 4.000 3.000 High/ Low Lean No CAM 10.000 Jul 21, 2014 NaN 2020 5'11 168lbs 72+2 72+2 72+2 76+2 75+2 75+2 75+2 76+2 76+2 76+2 76+2 75+2 71+2 71+2 71+2 75+2 60+2 58+2 58+2 58+2 60+2 56+2 50+2 50+2 50+2 56+2 75.000 72.000 57.000 77.000 71.000 81.000 84.000 80.000 74.000 78.000 73.000 77.000 78.000 74.000 64.000 74.000 61.000 65.000 66.000 77.000 63.000 32.000 73.000 76.000 80.000 77.000 45.000 35.000 38.000 16.000 15.000 16.000 13.000 11.000 €25M 1000000 11,000,000.000 1000 1000 11,000.000
1646 244260 Dani Olmo 20 https://cdn.sofifa.org/players/4/19/244260.png Spain https://cdn.sofifa.org/flags/45.png 75 85 Dinamo Zagreb https://cdn.sofifa.org/teams/2/light/211.png 11 1 1833 Right 1.000 4.000 4.000 High/ Medium Normal No CAM 7.000 Jul 31, 2014 NaN 2021 5'10 159lbs 67+2 67+2 67+2 74+2 72+2 72+2 72+2 74+2 74+2 74+2 74+2 74+2 69+2 69+2 69+2 74+2 57+2 55+2 55+2 55+2 57+2 54+2 44+2 44+2 44+2 54+2 77.000 70.000 43.000 75.000 62.000 74.000 72.000 75.000 78.000 76.000 77.000 80.000 77.000 69.000 64.000 68.000 55.000 63.000 53.000 71.000 47.000 27.000 69.000 76.000 62.000 73.000 40.000 35.000 32.000 15.000 15.000 13.000 12.000 11.000 €26.4M 1000000 11,000,000.000 1000 1000 11,000.000
835 202642 Fernando 26 https://cdn.sofifa.org/players/4/19/202642.png Brazil https://cdn.sofifa.org/flags/54.png 78 81 Spartak Moscow https://cdn.sofifa.org/teams/2/light/100767.png 11 1 2079 Right 1.000 3.000 3.000 Medium/ Medium Stocky No CDM 11.000 Jul 18, 2016 NaN 2021 5'9 176lbs 66+2 66+2 66+2 69+2 69+2 69+2 69+2 69+2 72+2 72+2 72+2 70+2 75+2 75+2 75+2 70+2 74+2 77+2 77+2 77+2 74+2 74+2 74+2 74+2 74+2 74+2 60.000 63.000 62.000 81.000 45.000 70.000 82.000 84.000 82.000 76.000 70.000 76.000 74.000 73.000 81.000 76.000 80.000 80.000 69.000 76.000 80.000 80.000 47.000 75.000 61.000 70.000 69.000 78.000 77.000 16.000 9.000 13.000 8.000 6.000 €23.9M 1000000 11,000,000.000 1000 1000 11,000.000
In [25]:
df['Overall'].unique()
Out[25]:
array([94, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77,
       76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60,
       59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46])
In [26]:
df['Value Number'].describe()
Out[26]:
count        18,207.000
mean      2,410,695.886
std       5,594,932.671
min               0.000
25%         300,000.000
50%         675,000.000
75%       2,000,000.000
max     118,500,000.000
Name: Value Number, dtype: float64
In [27]:
fig, ax = plt.subplots(figsize=(16, 8))

value_cond = df.loc[df['Overall'] > 75]
sns.regplot('Overall', 'Value Number', data=value_cond)

plt.title("Overall to Value", fontsize=16, fontweight='bold', color='white')
Out[27]:
Text(0.5,1,'Overall to Value')
In [28]:
df['Value to Overall'] = (df['Value Number'] / df['Overall'])
In [29]:
fig, ax = plt.subplots(figsize=(16, 8))

sns.distplot(df['Value to Overall'])

s = df.loc[df['Value to Overall'] > 880_000]

for i in s.index:
    ax.annotate(s.loc[i, 'Name'], (s.loc[i, 'Value to Overall'], 0.000005),
                rotation=90)

plt.title("Value vs Overall", fontsize=16, fontweight='bold', color='white')
Out[29]:
Text(0.5,1,'Value vs Overall')
In [30]:
df.loc[df['Stamina'].isna()].head()
Out[30]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause Value Multiplier Value Number Wage Multiplier Wage Number Value to Wage Value to Overall
13236 177971 J. McNulty 33 https://cdn.sofifa.org/players/4/19/177971.png Scotland https://cdn.sofifa.org/flags/42.png 62 62 Rochdale https://cdn.sofifa.org/teams/2/light/1955.png 120 1 1510 NaN nan nan nan NaN NaN NaN NaN nan NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan NaN 1000 120,000.000 1000 1000 120.000 1,935.484
13237 195380 J. Barrera 29 https://cdn.sofifa.org/players/4/19/195380.png Nicaragua https://cdn.sofifa.org/flags/86.png 62 62 Boyacá Chicó FC https://cdn.sofifa.org/teams/2/light/112019.png 300 1 1532 NaN nan nan nan NaN NaN NaN NaN nan NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan NaN 1000 300,000.000 1000 1000 300.000 4,838.710
13238 139317 J. Stead 35 https://cdn.sofifa.org/players/4/19/139317.png England https://cdn.sofifa.org/flags/14.png 62 62 Notts County https://cdn.sofifa.org/teams/2/light/1937.png 140 3 1573 NaN nan nan nan NaN NaN NaN NaN nan NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan NaN 1000 140,000.000 1000 3000 46.667 2,258.065
13239 240437 A. Semprini 20 https://cdn.sofifa.org/players/4/19/240437.png Italy https://cdn.sofifa.org/flags/27.png 62 72 Brescia https://cdn.sofifa.org/teams/2/light/190.png 425 1 1610 NaN nan nan nan NaN NaN NaN NaN nan NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan NaN 1000 425,000.000 1000 1000 425.000 6,854.839
13240 209462 R. Bingham 24 https://cdn.sofifa.org/players/4/19/209462.png England https://cdn.sofifa.org/flags/14.png 62 66 Hamilton Academical FC https://cdn.sofifa.org/teams/2/light/184.png 400 1 1481 NaN nan nan nan NaN NaN NaN NaN nan NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan NaN 1000 400,000.000 1000 1000 400.000 6,451.613
In [31]:
df.isna().sum().sort_values(ascending=False)
Out[31]:
Loaned From             16943
RDM                      2085
LM                       2085
LCB                      2085
LB                       2085
RWB                      2085
CDM                      2085
LDM                      2085
LWB                      2085
RM                       2085
RCM                      2085
CM                       2085
LCM                      2085
RAM                      2085
RB                       2085
CAM                      2085
LAM                      2085
RW                       2085
RF                       2085
CF                       2085
LF                       2085
LW                       2085
RS                       2085
ST                       2085
LS                       2085
CB                       2085
RCB                      2085
Release Clause           1564
Joined                   1553
Contract Valid Until      289
                        ...  
ShortPassing               48
HeadingAccuracy            48
Vision                     48
Finishing                  48
Balance                    48
ShotPower                  48
Jumping                    48
Stamina                    48
Strength                   48
LongShots                  48
Aggression                 48
Interceptions              48
Positioning                48
Age                         0
Name                        0
Photo                       0
Nationality                 0
Flag                        0
Overall                     0
Potential                   0
Value to Overall            0
Club Logo                   0
Value                       0
Wage                        0
Special                     0
Value Multiplier            0
Value Number                0
Wage Multiplier             0
Wage Number                 0
ID                          0
Length: 94, dtype: int64

Simplified position

In [32]:
ATTACKERS_SIMPLIFIED = """LS
ST
RS
LW
LF
CF
RF
RW
"""

MIDFIELDERS_SIMPLIFIED = """LAM
CAM
RAM
LM
LCM
CM
RCM
RM
LDM
CDM
RDM
"""

DEFENDERS_SIMPLIFIED = """
LWB
RWB
LB
LCB
CB
RCB
RB
"""
In [33]:
positions_mapping = {
    **{f'{pos.strip()}': 'Attacker' for pos in ATTACKERS_SIMPLIFIED.split('\n') if pos.strip()},
    **{f'{pos.strip()}': 'Midfielder' for pos in MIDFIELDERS_SIMPLIFIED.split('\n') if pos.strip()},
    **{f'{pos.strip()}': 'Defender' for pos in DEFENDERS_SIMPLIFIED.split('\n') if pos.strip()},
    'GK': 'Goalkeeper'
}

positions_mapping
Out[33]:
{'LS': 'Attacker',
 'ST': 'Attacker',
 'RS': 'Attacker',
 'LW': 'Attacker',
 'LF': 'Attacker',
 'CF': 'Attacker',
 'RF': 'Attacker',
 'RW': 'Attacker',
 'LAM': 'Midfielder',
 'CAM': 'Midfielder',
 'RAM': 'Midfielder',
 'LM': 'Midfielder',
 'LCM': 'Midfielder',
 'CM': 'Midfielder',
 'RCM': 'Midfielder',
 'RM': 'Midfielder',
 'LDM': 'Midfielder',
 'CDM': 'Midfielder',
 'RDM': 'Midfielder',
 'LWB': 'Defender',
 'RWB': 'Defender',
 'LB': 'Defender',
 'LCB': 'Defender',
 'CB': 'Defender',
 'RCB': 'Defender',
 'RB': 'Defender',
 'GK': 'Goalkeeper'}
In [34]:
df['SimplifiedPosition'] = df['Position'].map(positions_mapping)
In [35]:
df['SimplifiedPosition'].value_counts()
Out[35]:
Midfielder    6838
Defender      5866
Attacker      3418
Goalkeeper    2025
Name: SimplifiedPosition, dtype: int64
In [36]:
fig, ax = plt.subplots(figsize=(16, 6))

position_order = df.groupby('SimplifiedPosition')['SimplifiedPosition'].count().sort_values(ascending=False).index
sns.countplot(df['SimplifiedPosition'], order=position_order)

plt.title("Players by simplified Position", fontsize=16, fontweight='bold', color='white')
Out[36]:
Text(0.5,1,'Players by simplified Position')

Top-10 best paid players

In [37]:
top_player_wages = df.sort_values(by='Wage Number', ascending=False).head(10)
top_player_wages
Out[37]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause Value Multiplier Value Number Wage Multiplier Wage Number Value to Wage Value to Overall SimplifiedPosition
0 158023 L. Messi 31 https://cdn.sofifa.org/players/4/19/158023.png Argentina https://cdn.sofifa.org/flags/52.png 94 94 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png 110.5 565 2202 Left 5.000 4.000 4.000 Medium/ Medium Messi Yes RF 10.000 Jul 1, 2004 NaN 2021 5'7 159lbs 88+2 88+2 88+2 92+2 93+2 93+2 93+2 92+2 93+2 93+2 93+2 91+2 84+2 84+2 84+2 91+2 64+2 61+2 61+2 61+2 64+2 59+2 47+2 47+2 47+2 59+2 84.000 95.000 70.000 90.000 86.000 97.000 93.000 94.000 87.000 96.000 91.000 86.000 91.000 95.000 95.000 85.000 68.000 72.000 59.000 94.000 48.000 22.000 94.000 94.000 75.000 96.000 33.000 28.000 26.000 6.000 11.000 15.000 14.000 8.000 €226.5M 1000000 110,500,000.000 1000 565000 195.575 1,175,531.915 Attacker
7 176580 L. Suárez 31 https://cdn.sofifa.org/players/4/19/176580.png Uruguay https://cdn.sofifa.org/flags/60.png 91 91 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png 80 455 2346 Right 5.000 4.000 3.000 High/ Medium Normal Yes RS 9.000 Jul 11, 2014 NaN 2021 6'0 190lbs 87+5 87+5 87+5 86+5 87+5 87+5 87+5 86+5 85+5 85+5 85+5 84+5 79+5 79+5 79+5 84+5 69+5 68+5 68+5 68+5 69+5 66+5 63+5 63+5 63+5 66+5 77.000 93.000 77.000 82.000 88.000 87.000 86.000 84.000 64.000 90.000 86.000 75.000 82.000 92.000 83.000 86.000 69.000 90.000 83.000 85.000 87.000 41.000 92.000 84.000 85.000 85.000 62.000 45.000 38.000 27.000 25.000 31.000 33.000 37.000 €164M 1000000 80,000,000.000 1000 455000 175.824 879,120.879 Attacker
6 177003 L. Modrić 32 https://cdn.sofifa.org/players/4/19/177003.png Croatia https://cdn.sofifa.org/flags/10.png 91 91 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 67 420 2280 Right 4.000 4.000 4.000 High/ High Lean Yes RCM 10.000 Aug 1, 2012 NaN 2020 5'8 146lbs 77+3 77+3 77+3 85+3 84+3 84+3 84+3 85+3 87+3 87+3 87+3 86+3 88+3 88+3 88+3 86+3 82+3 81+3 81+3 81+3 82+3 79+3 71+3 71+3 71+3 79+3 86.000 72.000 55.000 93.000 76.000 90.000 85.000 78.000 88.000 93.000 80.000 72.000 93.000 90.000 94.000 79.000 68.000 89.000 58.000 82.000 62.000 83.000 79.000 92.000 82.000 84.000 60.000 76.000 73.000 13.000 9.000 7.000 14.000 9.000 €137.4M 1000000 67,000,000.000 1000 420000 159.524 736,263.736 Midfielder
1 20801 Cristiano Ronaldo 33 https://cdn.sofifa.org/players/4/19/20801.png Portugal https://cdn.sofifa.org/flags/38.png 94 94 Juventus https://cdn.sofifa.org/teams/2/light/45.png 77 405 2228 Right 5.000 4.000 5.000 High/ Low C. Ronaldo Yes ST 7.000 Jul 10, 2018 NaN 2022 6'2 183lbs 91+3 91+3 91+3 89+3 90+3 90+3 90+3 89+3 88+3 88+3 88+3 88+3 81+3 81+3 81+3 88+3 65+3 61+3 61+3 61+3 65+3 61+3 53+3 53+3 53+3 61+3 84.000 94.000 89.000 81.000 87.000 88.000 81.000 76.000 77.000 94.000 89.000 91.000 87.000 96.000 70.000 95.000 95.000 88.000 79.000 93.000 63.000 29.000 95.000 82.000 85.000 95.000 28.000 31.000 23.000 7.000 11.000 15.000 14.000 11.000 €127.1M 1000000 77,000,000.000 1000 405000 190.123 819,148.936 Attacker
8 155862 Sergio Ramos 32 https://cdn.sofifa.org/players/4/19/155862.png Spain https://cdn.sofifa.org/flags/45.png 91 91 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 51 380 2201 Right 4.000 3.000 3.000 High/ Medium Normal Yes RCB 15.000 Aug 1, 2005 NaN 2020 6'0 181lbs 73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3 71+3 71+3 71+3 72+3 75+3 75+3 75+3 72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3 87+3 87+3 84+3 66.000 60.000 91.000 78.000 66.000 63.000 74.000 72.000 77.000 84.000 76.000 75.000 78.000 85.000 66.000 79.000 93.000 84.000 83.000 59.000 88.000 90.000 60.000 63.000 75.000 82.000 87.000 92.000 91.000 11.000 8.000 9.000 7.000 11.000 €104.6M 1000000 51,000,000.000 1000 380000 134.211 560,439.560 Defender
11 182521 T. Kroos 28 https://cdn.sofifa.org/players/4/19/182521.png Germany https://cdn.sofifa.org/flags/21.png 90 90 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 76.5 355 2190 Right 4.000 5.000 3.000 Medium/ Medium Normal Yes LCM 8.000 Jul 17, 2014 NaN 2022 6'0 168lbs 78+3 78+3 78+3 81+3 82+3 82+3 82+3 81+3 84+3 84+3 84+3 82+3 86+3 86+3 86+3 82+3 79+3 82+3 82+3 82+3 79+3 77+3 72+3 72+3 72+3 77+3 88.000 76.000 54.000 92.000 82.000 81.000 86.000 84.000 93.000 90.000 64.000 62.000 70.000 89.000 71.000 87.000 30.000 75.000 73.000 92.000 60.000 82.000 79.000 86.000 73.000 85.000 72.000 79.000 69.000 10.000 11.000 13.000 7.000 10.000 €156.8M 1000000 76,500,000.000 1000 355000 215.493 850,000.000 Midfielder
36 173731 G. Bale 28 https://cdn.sofifa.org/players/4/19/173731.png Wales https://cdn.sofifa.org/flags/50.png 88 88 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 60 355 2279 Left 4.000 3.000 4.000 High/ Medium Lean Yes ST 11.000 Sep 2, 2013 NaN 2022 6'1 181lbs 86+3 86+3 86+3 86+3 86+3 86+3 86+3 86+3 85+3 85+3 85+3 85+3 80+3 80+3 80+3 85+3 73+3 70+3 70+3 70+3 73+3 71+3 67+3 67+3 67+3 71+3 87.000 86.000 84.000 85.000 85.000 87.000 90.000 87.000 80.000 85.000 94.000 95.000 82.000 85.000 65.000 92.000 87.000 75.000 80.000 91.000 65.000 59.000 85.000 79.000 76.000 86.000 54.000 55.000 52.000 15.000 15.000 11.000 5.000 6.000 €123M 1000000 60,000,000.000 1000 355000 169.014 681,818.182 Attacker
4 192985 K. De Bruyne 27 https://cdn.sofifa.org/players/4/19/192985.png Belgium https://cdn.sofifa.org/flags/7.png 91 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png 102 355 2281 Right 4.000 5.000 4.000 High/ High Normal Yes RCM 7.000 Aug 30, 2015 NaN 2023 5'11 154lbs 82+3 82+3 82+3 87+3 87+3 87+3 87+3 87+3 88+3 88+3 88+3 88+3 87+3 87+3 87+3 88+3 77+3 77+3 77+3 77+3 77+3 73+3 66+3 66+3 66+3 73+3 93.000 82.000 55.000 92.000 82.000 86.000 85.000 83.000 91.000 91.000 78.000 76.000 79.000 91.000 77.000 91.000 63.000 90.000 75.000 91.000 76.000 61.000 87.000 94.000 79.000 88.000 68.000 58.000 51.000 15.000 13.000 5.000 10.000 13.000 €196.4M 1000000 102,000,000.000 1000 355000 287.324 1,120,879.121 Midfielder
5 183277 E. Hazard 27 https://cdn.sofifa.org/players/4/19/183277.png Belgium https://cdn.sofifa.org/flags/7.png 91 91 Chelsea https://cdn.sofifa.org/teams/2/light/5.png 93 340 2142 Right 4.000 4.000 4.000 High/ Medium Normal Yes LF 10.000 Jul 1, 2012 NaN 2020 5'8 163lbs 83+3 83+3 83+3 89+3 88+3 88+3 88+3 89+3 89+3 89+3 89+3 89+3 82+3 82+3 82+3 89+3 66+3 63+3 63+3 63+3 66+3 60+3 49+3 49+3 49+3 60+3 81.000 84.000 61.000 89.000 80.000 95.000 83.000 79.000 83.000 94.000 94.000 88.000 95.000 90.000 94.000 82.000 56.000 83.000 66.000 80.000 54.000 41.000 87.000 89.000 86.000 91.000 34.000 27.000 22.000 11.000 12.000 6.000 8.000 8.000 €172.1M 1000000 93,000,000.000 1000 340000 273.529 1,021,978.022 Attacker
32 189242 Coutinho 26 https://cdn.sofifa.org/players/4/19/189242.png Brazil https://cdn.sofifa.org/flags/54.png 88 89 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png 69.5 340 2175 Right 3.000 4.000 5.000 High/ High Normal Yes LW 7.000 Jan 6, 2018 NaN 2023 5'8 150lbs 79+3 79+3 79+3 86+3 85+3 85+3 85+3 86+3 87+3 87+3 87+3 85+3 83+3 83+3 83+3 85+3 71+3 70+3 70+3 70+3 71+3 67+3 58+3 58+3 58+3 67+3 79.000 79.000 48.000 88.000 75.000 91.000 91.000 86.000 83.000 92.000 89.000 75.000 92.000 83.000 93.000 83.000 59.000 79.000 61.000 93.000 59.000 49.000 84.000 90.000 70.000 85.000 55.000 54.000 47.000 12.000 7.000 9.000 14.000 6.000 €147.7M 1000000 69,500,000.000 1000 340000 204.412 789,772.727 Attacker
In [38]:
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
import requests
from PIL import Image
from io import BytesIO
In [39]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Name', x='Wage Number', orient='h', data=top_player_wages,
            color=flatui_palette[5])

for pos, i in enumerate(top_player_wages.index):
    r = requests.get(top_player_wages.loc[i, 'Photo'])
    img = Image.open(BytesIO(r.content))
    oi = OffsetImage(img, zoom=0.8)
    box = AnnotationBbox(oi, (3500, pos-0.48), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Top-10 player wages", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[39]:
Text(0.5,1,'Top-10 player wages')

 Top nationality / Value Number

In [40]:
top_nations_value = df.groupby('Nationality')['Value Number'].sum().sort_values(ascending=False).head(10)
top_nations_value = pd.DataFrame(top_nations_value)

for i in top_nations_value.index:
    top_nations_value.loc[i, 'Flag'] = df[df['Nationality'] == i].head(1)['Flag'].values[0]
    
top_nations_value = top_nations_value.reset_index()
top_nations_value.columns = ['Nation', 'Estimated Value', 'Flag']

top_nations_value
Out[40]:
Nation Estimated Value Flag
0 Spain 4,706,850,000.000 https://cdn.sofifa.org/flags/45.png
1 Brazil 3,806,375,000.000 https://cdn.sofifa.org/flags/54.png
2 France 3,363,355,000.000 https://cdn.sofifa.org/flags/18.png
3 Germany 3,030,110,000.000 https://cdn.sofifa.org/flags/21.png
4 Argentina 2,883,160,000.000 https://cdn.sofifa.org/flags/52.png
5 England 2,490,915,000.000 https://cdn.sofifa.org/flags/14.png
6 Italy 2,139,395,000.000 https://cdn.sofifa.org/flags/27.png
7 Portugal 1,630,500,000.000 https://cdn.sofifa.org/flags/38.png
8 Netherlands 1,300,180,000.000 https://cdn.sofifa.org/flags/34.png
9 Belgium 1,221,915,000.000 https://cdn.sofifa.org/flags/7.png
In [41]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Nation', x='Estimated Value', orient='h', data=top_nations_value,
            color=flatui_palette[2])

for pos, i in enumerate(top_nations_value.index):
    r = requests.get(top_nations_value.loc[i, 'Flag'])
    img = Image.open(BytesIO(r.content))
    oi = OffsetImage(img, zoom=1.2)
    box = AnnotationBbox(oi, (60_000_000, pos-0.25), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Top-10 most 'valuable' nations", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[41]:
Text(0.5,1,"Top-10 most 'valuable' nations")

 Top clubs / Value Number

In [42]:
top_clubs_value = df.groupby('Club')['Value Number'].sum().sort_values(ascending=False).head(10)
top_clubs_value = pd.DataFrame(top_clubs_value)

for i in top_clubs_value.index:
    top_clubs_value.loc[i, 'Club Logo'] = df[df['Club'] == i].head(1)['Club Logo'].values[0]
    
top_clubs_value = top_clubs_value.reset_index()
top_clubs_value.columns = ['Club', 'Estimated Value', 'Club Logo']

top_clubs_value
Out[42]:
Club Estimated Value Club Logo
0 Real Madrid 874,425,000.000 https://cdn.sofifa.org/teams/2/light/243.png
1 FC Barcelona 852,600,000.000 https://cdn.sofifa.org/teams/2/light/241.png
2 Manchester City 786,555,000.000 https://cdn.sofifa.org/teams/2/light/10.png
3 Juventus 704,475,000.000 https://cdn.sofifa.org/teams/2/light/45.png
4 FC Bayern München 679,025,000.000 https://cdn.sofifa.org/teams/2/light/21.png
5 Atlético Madrid 644,525,000.000 https://cdn.sofifa.org/teams/2/light/240.png
6 Paris Saint-Germain 625,325,000.000 https://cdn.sofifa.org/teams/2/light/73.png
7 Tottenham Hotspur 618,450,000.000 https://cdn.sofifa.org/teams/2/light/18.png
8 Chelsea 606,815,000.000 https://cdn.sofifa.org/teams/2/light/5.png
9 Manchester United 588,850,000.000 https://cdn.sofifa.org/teams/2/light/11.png
In [43]:
!pip install imageio
import imageio
Requirement already satisfied: imageio in /usr/local/lib/python3.6/site-packages (2.6.1)
Requirement already satisfied: pillow in /usr/local/lib/python3.6/site-packages (from imageio) (5.2.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/site-packages (from imageio) (1.14.5)
WARNING: You are using pip version 19.1.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
In [44]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Club', x='Estimated Value', orient='h', data=top_clubs_value,
            color=flatui_palette[3])

for pos, i in enumerate(top_clubs_value.index):
    r = requests.get(top_clubs_value.loc[i, 'Club Logo'])
    img = imageio.imread(BytesIO(r.content), pilmode='RGBA')
    img = Image.fromarray(img)

    oi = OffsetImage(img, zoom=1)
    box = AnnotationBbox(oi, (6_500_000, pos-0.3), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Top-10 most 'valuable' clubs", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[44]:
Text(0.5,1,"Top-10 most 'valuable' clubs")

Most valuable clubs on the 90th percentile

In [45]:
club_90 = df.groupby('Club')['Value Number'].apply(lambda g: g.quantile(.9)).sort_values(ascending=False).head(10)
club_90 = pd.DataFrame(club_90)

for i in club_90.index:
    club_90.loc[i, 'Club Logo'] = df[df['Club'] == i].head(1)['Club Logo'].values[0]
    
club_90 = club_90.reset_index()
club_90.columns = ['Club', 'Estimated Value', 'Club Logo']

club_90
Out[45]:
Club Estimated Value Club Logo
0 Manchester City 59,900,000.000 https://cdn.sofifa.org/teams/2/light/10.png
1 Real Madrid 59,900,000.000 https://cdn.sofifa.org/teams/2/light/243.png
2 FC Barcelona 57,800,000.000 https://cdn.sofifa.org/teams/2/light/241.png
3 Paris Saint-Germain 55,500,000.000 https://cdn.sofifa.org/teams/2/light/73.png
4 Napoli 45,900,000.000 https://cdn.sofifa.org/teams/2/light/48.png
5 FC Bayern München 45,600,000.000 https://cdn.sofifa.org/teams/2/light/21.png
6 Juventus 45,500,000.000 https://cdn.sofifa.org/teams/2/light/45.png
7 Atlético Madrid 44,800,000.000 https://cdn.sofifa.org/teams/2/light/240.png
8 Liverpool 42,900,000.000 https://cdn.sofifa.org/teams/2/light/9.png
9 Manchester United 41,500,000.000 https://cdn.sofifa.org/teams/2/light/11.png
In [46]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Club', x='Estimated Value', orient='h', data=club_90,
            color=flatui_palette[3])

for pos, i in enumerate(club_90.index):
    r = requests.get(club_90.loc[i, 'Club Logo'])
    img = imageio.imread(BytesIO(r.content), pilmode='RGBA')
    img = Image.fromarray(img)
    oi = OffsetImage(img, zoom=1)
    box = AnnotationBbox(oi, (600_000, pos-0.3), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Most valuable clubs on the 90th percentile", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[46]:
Text(0.5,1,'Most valuable clubs on the 90th percentile')

 Top growth players

In [47]:
df['Growth'] = df['Potential'] - df['Overall']
In [48]:
top_growth_players = df.sort_values(by='Growth', ascending=False).head(10)[['Name', 'Growth', 'Club Logo']]

top_growth_players
Out[48]:
Name Growth Club Logo
18072 D. Campbell 26 https://cdn.sofifa.org/teams/2/light/77.png
16028 J. von Moos 26 https://cdn.sofifa.org/teams/2/light/896.png
17175 B. Mumba 25 https://cdn.sofifa.org/teams/2/light/106.png
16629 Y. Lenze 25 https://cdn.sofifa.org/teams/2/light/34.png
17784 K. Askildsen 25 https://cdn.sofifa.org/teams/2/light/917.png
13927 A. Dabo 24 https://cdn.sofifa.org/teams/2/light/71.png
18050 E. Destanoglu 24 https://cdn.sofifa.org/teams/2/light/327.png
18166 N. Ayéva 24 https://cdn.sofifa.org/teams/2/light/705.png
15728 G. Azzinnari 24 https://cdn.sofifa.org/teams/2/light/112168.png
18044 K. Lara 24 https://cdn.sofifa.org/teams/2/light/112528.png
In [49]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Name', x='Growth', orient='h', data=top_growth_players,
            color=flatui_palette[5])

for pos, i in enumerate(top_growth_players.index):
    r = requests.get(top_growth_players.loc[i, 'Club Logo'])
    img = Image.open(BytesIO(r.content))
    oi = OffsetImage(img, zoom=1)
    box = AnnotationBbox(oi, (0.25, pos-0.3), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Top-10 players with highest potential to grow", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[49]:
Text(0.5,1,'Top-10 players with highest potential to grow')
In [50]:
top_growth_players = df.sort_values(by='Growth', ascending=False)

top_growth_players_90 = top_growth_players[top_growth_players['Potential'] > 90].head(10)

top_growth_players_90
Out[50]:
ID Name Age Photo Nationality Flag Overall Potential Club Club Logo Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Work Rate Body Type Real Face Position Jersey Number Joined Loaned From Contract Valid Until Height Weight LS ST RS LW LF CF RF RW LAM CAM RAM LM LCM CM RCM RM LWB LDM CDM RDM RWB LB LCB CB RCB RB Crossing Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower Jumping Stamina Strength LongShots Aggression Interceptions Positioning Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause Value Multiplier Value Number Wage Multiplier Wage Number Value to Wage Value to Overall SimplifiedPosition Growth
1143 238794 Vinícius Júnior 17 https://cdn.sofifa.org/players/4/19/238794.png Brazil https://cdn.sofifa.org/flags/54.png 77 92 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 17.5 66 1849 Right 1.000 4.000 5.000 High/ Medium Lean No LW 28.000 Jul 12, 2018 NaN 2025 5'9 161lbs 72+2 72+2 72+2 76+2 75+2 75+2 75+2 76+2 74+2 74+2 74+2 75+2 65+2 65+2 65+2 75+2 56+2 50+2 50+2 50+2 56+2 52+2 42+2 42+2 42+2 52+2 65.000 70.000 50.000 70.000 71.000 81.000 77.000 62.000 48.000 80.000 92.000 94.000 90.000 70.000 82.000 74.000 74.000 79.000 59.000 68.000 48.000 26.000 74.000 69.000 65.000 75.000 32.000 25.000 18.000 5.000 7.000 7.000 7.000 10.000 €46.8M 1000000 17,500,000.000 1000 66000 265.152 227,272.727 Attacker 15
229 230621 G. Donnarumma 19 https://cdn.sofifa.org/players/4/19/230621.png Italy https://cdn.sofifa.org/flags/27.png 82 93 Milan https://cdn.sofifa.org/teams/2/light/47.png 29 23 1278 Right 3.000 3.000 1.000 Medium/ Medium Normal Yes GK 22.000 Jul 1, 2015 NaN 2021 6'5 198lbs NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 12.000 12.000 12.000 34.000 8.000 28.000 12.000 14.000 24.000 28.000 46.000 54.000 64.000 74.000 38.000 24.000 72.000 34.000 72.000 18.000 30.000 26.000 14.000 50.000 24.000 68.000 20.000 14.000 16.000 88.000 78.000 72.000 78.000 88.000 €55.1M 1000000 29,000,000.000 1000 23000 1,260.870 353,658.537 Goalkeeper 11
155 231443 O. Dembélé 21 https://cdn.sofifa.org/players/4/19/231443.png France https://cdn.sofifa.org/flags/18.png 83 92 FC Barcelona https://cdn.sofifa.org/teams/2/light/241.png 40 155 1993 Left 3.000 5.000 4.000 High/ Low Lean Yes RW 11.000 Aug 28, 2017 NaN 2022 5'10 148lbs 76+3 76+3 76+3 83+3 82+3 82+3 82+3 83+3 82+3 82+3 82+3 82+3 74+3 74+3 74+3 82+3 63+3 58+3 58+3 58+3 63+3 59+3 46+3 46+3 46+3 59+3 78.000 78.000 43.000 78.000 76.000 90.000 78.000 64.000 70.000 83.000 93.000 92.000 90.000 82.000 85.000 83.000 59.000 73.000 46.000 70.000 54.000 36.000 79.000 84.000 75.000 75.000 42.000 30.000 33.000 6.000 6.000 14.000 10.000 13.000 €90M 1000000 40,000,000.000 1000 155000 258.065 481,927.711 Attacker 9
156 230666 Gabriel Jesus 21 https://cdn.sofifa.org/players/4/19/230666.png Brazil https://cdn.sofifa.org/flags/54.png 83 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png 41 130 2051 Right 2.000 3.000 4.000 High/ High Normal Yes ST 33.000 Aug 3, 2016 NaN 2023 5'9 161lbs 81+2 81+2 81+2 82+2 83+2 83+2 83+2 82+2 81+2 81+2 81+2 81+2 73+2 73+2 73+2 81+2 61+2 59+2 59+2 59+2 61+2 57+2 52+2 52+2 52+2 57+2 66.000 84.000 74.000 76.000 72.000 86.000 76.000 54.000 66.000 85.000 87.000 85.000 92.000 86.000 91.000 78.000 77.000 84.000 68.000 73.000 73.000 32.000 88.000 77.000 78.000 82.000 53.000 23.000 19.000 13.000 8.000 6.000 6.000 15.000 €84.1M 1000000 41,000,000.000 1000 130000 315.385 493,975.904 Attacker 9
226 235243 M. de Ligt 18 https://cdn.sofifa.org/players/4/19/235243.png Netherlands https://cdn.sofifa.org/flags/34.png 82 91 Ajax https://cdn.sofifa.org/teams/2/light/245.png 27 11 1937 Right 2.000 4.000 2.000 Medium/ Medium Normal Yes RCB 3.000 Oct 24, 2016 NaN 2021 6'2 196lbs 66+2 66+2 66+2 63+2 65+2 65+2 65+2 63+2 65+2 65+2 65+2 65+2 70+2 70+2 70+2 65+2 73+2 77+2 77+2 77+2 73+2 75+2 80+2 80+2 80+2 75+2 57.000 53.000 81.000 75.000 40.000 65.000 48.000 55.000 72.000 73.000 62.000 72.000 56.000 77.000 59.000 79.000 80.000 74.000 87.000 64.000 79.000 79.000 44.000 63.000 40.000 77.000 84.000 84.000 79.000 12.000 11.000 11.000 12.000 10.000 €43.2M 1000000 27,000,000.000 1000 11000 2,454.545 329,268.293 Defender 9
177 206585 Kepa 23 https://cdn.sofifa.org/players/4/19/206585.png Spain https://cdn.sofifa.org/flags/45.png 83 91 Chelsea https://cdn.sofifa.org/teams/2/light/5.png 28.5 84 1223 Right 1.000 4.000 1.000 Medium/ Medium Lean Yes GK 13.000 Aug 8, 2018 NaN 2025 6'1 187lbs NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 25.000 11.000 17.000 32.000 18.000 10.000 25.000 19.000 36.000 16.000 34.000 33.000 41.000 79.000 39.000 25.000 71.000 37.000 51.000 14.000 18.000 21.000 15.000 55.000 24.000 63.000 19.000 18.000 16.000 84.000 80.000 76.000 80.000 84.000 €58.4M 1000000 28,500,000.000 1000 84000 339.286 343,373.494 Goalkeeper 8
25 231747 K. Mbappé 19 https://cdn.sofifa.org/players/4/19/231747.png France https://cdn.sofifa.org/flags/18.png 88 95 Paris Saint-Germain https://cdn.sofifa.org/teams/2/light/73.png 81 100 2118 Right 3.000 4.000 5.000 High/ Medium Lean Yes RM 10.000 Jul 1, 2018 NaN 2022 5'10 161lbs 85+3 85+3 85+3 87+3 87+3 87+3 87+3 87+3 86+3 86+3 86+3 86+3 78+3 78+3 78+3 86+3 66+3 62+3 62+3 62+3 66+3 62+3 54+3 54+3 54+3 62+3 77.000 88.000 77.000 82.000 78.000 90.000 77.000 63.000 73.000 91.000 96.000 96.000 92.000 87.000 83.000 79.000 75.000 83.000 71.000 78.000 62.000 38.000 88.000 82.000 70.000 86.000 34.000 34.000 32.000 13.000 5.000 7.000 11.000 6.000 €166.1M 1000000 81,000,000.000 1000 100000 810.000 920,454.545 Midfielder 7
77 232363 M. Škriniar 23 https://cdn.sofifa.org/players/4/19/232363.png Slovakia https://cdn.sofifa.org/flags/43.png 85 92 Inter https://cdn.sofifa.org/teams/2/light/44.png 46.5 82 1800 Right 1.000 4.000 2.000 Medium/ High Normal No LCB 37.000 Jul 7, 2017 NaN 2022 6'2 176lbs 57+2 57+2 57+2 56+2 57+2 57+2 57+2 56+2 58+2 58+2 58+2 60+2 65+2 65+2 65+2 60+2 73+2 78+2 78+2 78+2 73+2 76+2 83+2 83+2 83+2 76+2 40.000 42.000 80.000 70.000 40.000 59.000 34.000 30.000 68.000 67.000 70.000 73.000 48.000 81.000 48.000 50.000 78.000 77.000 83.000 30.000 86.000 86.000 30.000 57.000 56.000 80.000 92.000 88.000 82.000 10.000 13.000 12.000 8.000 12.000 €88.4M 1000000 46,500,000.000 1000 82000 567.073 547,058.824 Defender 7
79 220834 Marco Asensio 22 https://cdn.sofifa.org/players/4/19/220834.png Spain https://cdn.sofifa.org/flags/45.png 85 92 Real Madrid https://cdn.sofifa.org/teams/2/light/243.png 54 215 2050 Left 3.000 3.000 4.000 High/ Medium Normal Yes RW 10.000 Jul 1, 2015 NaN 2023 6'0 168lbs 79+3 79+3 79+3 83+3 83+3 83+3 83+3 83+3 83+3 83+3 83+3 83+3 79+3 79+3 79+3 83+3 66+3 63+3 63+3 63+3 66+3 62+3 51+3 51+3 51+3 62+3 82.000 82.000 50.000 83.000 79.000 86.000 83.000 76.000 82.000 85.000 85.000 82.000 79.000 82.000 76.000 86.000 58.000 76.000 61.000 88.000 45.000 45.000 82.000 84.000 62.000 83.000 40.000 42.000 39.000 13.000 9.000 6.000 12.000 10.000 €121.5M 1000000 54,000,000.000 1000 215000 251.163 635,294.118 Attacker 7
55 222492 L. Sané 22 https://cdn.sofifa.org/players/4/19/222492.png Germany https://cdn.sofifa.org/flags/21.png 86 92 Manchester City https://cdn.sofifa.org/teams/2/light/10.png 61 195 2090 Left 2.000 3.000 4.000 High/ Medium Lean Yes LW 19.000 Aug 2, 2016 NaN 2021 6'0 165lbs 82+2 82+2 82+2 84+2 84+2 84+2 84+2 84+2 82+2 82+2 82+2 83+2 74+2 74+2 74+2 83+2 65+2 59+2 59+2 59+2 65+2 61+2 52+2 52+2 52+2 61+2 83.000 81.000 72.000 79.000 85.000 88.000 82.000 68.000 64.000 85.000 93.000 96.000 88.000 81.000 81.000 86.000 64.000 79.000 70.000 78.000 61.000 34.000 84.000 82.000 71.000 78.000 36.000 32.000 35.000 8.000 12.000 9.000 9.000 14.000 €125.1M 1000000 61,000,000.000 1000 195000 312.821 709,302.326 Attacker 6
In [51]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Name', x='Growth', orient='h', data=top_growth_players_90,
            color=flatui_palette[5])

for pos, i in enumerate(top_growth_players_90.index):
    r = requests.get(top_growth_players_90.loc[i, 'Club Logo'])
    img = Image.open(BytesIO(r.content))
    oi = OffsetImage(img, zoom=1)
    box = AnnotationBbox(oi, (0.15, pos-0.3), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Top-10 players with highest potential to grow (>90 Potential)", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[51]:
Text(0.5,1,'Top-10 players with highest potential to grow (>90 Potential)')

What clubs have the most number of loaned players?

In [52]:
club_loaned = df.groupby('Loaned From')['Name'].count().sort_values(ascending=False).head(10)
club_loaned = pd.DataFrame(club_loaned)

for i in club_loaned.index:
    club_loaned.loc[i, 'Club Logo'] = df[df['Club'] == i].head(1)['Club Logo'].values[0]
    
club_loaned = club_loaned.reset_index()
club_loaned.columns = ['Club', 'Loaned Players', 'Club Logo']

club_loaned
Out[52]:
Club Loaned Players Club Logo
0 Atalanta 20 https://cdn.sofifa.org/teams/2/light/39.png
1 Sassuolo 18 https://cdn.sofifa.org/teams/2/light/111974.png
2 Juventus 17 https://cdn.sofifa.org/teams/2/light/45.png
3 SL Benfica 17 https://cdn.sofifa.org/teams/2/light/234.png
4 Sporting CP 14 https://cdn.sofifa.org/teams/2/light/237.png
5 Liverpool 12 https://cdn.sofifa.org/teams/2/light/9.png
6 Manchester City 12 https://cdn.sofifa.org/teams/2/light/10.png
7 Leeds United 12 https://cdn.sofifa.org/teams/2/light/8.png
8 Udinese 12 https://cdn.sofifa.org/teams/2/light/55.png
9 AS Monaco 12 https://cdn.sofifa.org/teams/2/light/69.png
In [53]:
fig, ax = plt.subplots(figsize=(16, 8))

# need to change 'x' and 'y' to plot horizontally
sns.barplot(y='Club', x='Loaned Players', orient='h', data=club_loaned,
            color=flatui_palette[3])

for pos, i in enumerate(club_loaned.index):
    r = requests.get(club_loaned.loc[i, 'Club Logo'])
    img = imageio.imread(BytesIO(r.content), pilmode='RGBA')
    img = Image.fromarray(img)
    oi = OffsetImage(img, zoom=1)
    box = AnnotationBbox(oi, (0.15, pos-0.3), frameon=False, box_alignment=(0.5, 1))
    ax.add_artist(box)

plt.title("Clubs with more Loaned players", fontsize=16, fontweight='bold', color='white')
#plt.xticks(rotation=45)
Out[53]:
Text(0.5,1,'Clubs with more Loaned players')

 Create a correlation heatmap of the most important skills of players

In [54]:
s = df[['HeadingAccuracy',
'Jumping',
'ShortPassing',
'LongPassing',
'BallControl',
'Dribbling',
'Acceleration',
'Agility',
'Finishing',
'ShotPower']]

corr = s.corr()
In [55]:
fig, ax = plt.subplots(figsize=(16, 8))

sns.heatmap(corr, cmap="RdBu_r", center=0)

plt.title("Correlation of most important player skills", fontsize=16, fontweight='bold', color='white')
Out[55]:
Text(0.5,1,'Correlation of most important player skills')

 Radar

In [56]:
from math import pi

def make_radar(player_names, features):
    players_data = df[df['Name'].isin(player_names)]
    players_df = pd.DataFrame(players_data[features])
    players_df['Name'] = player_names
    print(players_df)
    
    fig, ax = plt.subplots(figsize=(8, 8))
    ax = plt.subplot(1,1,1, polar=True)
    plt.title('Comparing player skills', fontsize=16, fontweight='bold', color='white')

    for row in range(0, len(players_df.index)):
        all_features=list(players_df)[:-1]
        N = len(all_features)
        angles = [n / float(N) * 2 * pi for n in range(N)]
        angles += angles[:1]
        ax.set_theta_offset(pi / 2)
        ax.set_theta_direction(-1)

        plt.xticks(angles[:-1], all_features)
        ax.set_rlabel_position(0)

        values=players_df.loc[row].drop('Name').values.flatten().tolist()
        values += values[:1]
        ax.plot(angles, values, linewidth=2, color=flatui_palette[row], linestyle='solid')
        ax.fill(angles, values, color=flatui_palette[row], alpha=0.4)
        plt.legend(players_df['Name'], loc="upper right")
In [57]:
player_names = ['L. Messi', 'Cristiano Ronaldo']
features = ['Dribbling', 'BallControl', 'Acceleration', 'ShotPower', 'Vision']

make_radar(player_names, features)
   Dribbling  BallControl  Acceleration  ShotPower  Vision               Name
0     97.000       96.000        91.000     85.000  94.000           L. Messi
1     88.000       94.000        89.000     95.000  82.000  Cristiano Ronaldo
Notebooks AI
Notebooks AI Profile20060