Assignment 1

fifa19 players dataset

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv("data.csv", index_col=0)
pd.set_option('display.max_columns', None)
df
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
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.0 4.0 4.0 Medium/ Medium Messi Yes RF 10.0 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.0 95.0 70.0 90.0 86.0 97.0 93.0 94.0 87.0 96.0 91.0 86.0 91.0 95.0 95.0 85.0 68.0 72.0 59.0 94.0 48.0 22.0 94.0 94.0 75.0 96.0 33.0 28.0 26.0 6.0 11.0 15.0 14.0 8.0 €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.0 4.0 5.0 High/ Low C. Ronaldo Yes ST 7.0 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.0 94.0 89.0 81.0 87.0 88.0 81.0 76.0 77.0 94.0 89.0 91.0 87.0 96.0 70.0 95.0 95.0 88.0 79.0 93.0 63.0 29.0 95.0 82.0 85.0 95.0 28.0 31.0 23.0 7.0 11.0 15.0 14.0 11.0 €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.0 5.0 5.0 High/ Medium Neymar Yes LW 10.0 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.0 87.0 62.0 84.0 84.0 96.0 88.0 87.0 78.0 95.0 94.0 90.0 96.0 94.0 84.0 80.0 61.0 81.0 49.0 82.0 56.0 36.0 89.0 87.0 81.0 94.0 27.0 24.0 33.0 9.0 9.0 15.0 15.0 11.0 €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.0 3.0 1.0 Medium/ Medium Lean Yes GK 1.0 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.0 13.0 21.0 50.0 13.0 18.0 21.0 19.0 51.0 42.0 57.0 58.0 60.0 90.0 43.0 31.0 67.0 43.0 64.0 12.0 38.0 30.0 12.0 68.0 40.0 68.0 15.0 21.0 13.0 90.0 85.0 87.0 88.0 94.0 €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.0 5.0 4.0 High/ High Normal Yes RCM 7.0 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.0 82.0 55.0 92.0 82.0 86.0 85.0 83.0 91.0 91.0 78.0 76.0 79.0 91.0 77.0 91.0 63.0 90.0 75.0 91.0 76.0 61.0 87.0 94.0 79.0 88.0 68.0 58.0 51.0 15.0 13.0 5.0 10.0 13.0 €196.4M
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
18202 238813 J. Lundstram 19 https://cdn.sofifa.org/players/4/19/238813.png England https://cdn.sofifa.org/flags/14.png 47 65 Crewe Alexandra https://cdn.sofifa.org/teams/2/light/121.png €60K €1K 1307 Right 1.0 2.0 2.0 Medium/ Medium Lean No CM 22.0 May 3, 2017 NaN 2019 5'9 134lbs 42+2 42+2 42+2 44+2 44+2 44+2 44+2 44+2 45+2 45+2 45+2 44+2 45+2 45+2 45+2 44+2 44+2 45+2 45+2 45+2 44+2 45+2 45+2 45+2 45+2 45+2 34.0 38.0 40.0 49.0 25.0 42.0 30.0 34.0 45.0 43.0 54.0 57.0 60.0 49.0 76.0 43.0 55.0 40.0 47.0 38.0 46.0 46.0 39.0 52.0 43.0 45.0 40.0 48.0 47.0 10.0 13.0 7.0 8.0 9.0 €143K
18203 243165 N. Christoffersson 19 https://cdn.sofifa.org/players/4/19/243165.png Sweden https://cdn.sofifa.org/flags/46.png 47 63 Trelleborgs FF https://cdn.sofifa.org/teams/2/light/703.png €60K €1K 1098 Right 1.0 2.0 2.0 Medium/ Medium Normal No ST 21.0 Mar 19, 2018 NaN 2020 6'3 170lbs 45+2 45+2 45+2 39+2 42+2 42+2 42+2 39+2 40+2 40+2 40+2 38+2 35+2 35+2 35+2 38+2 30+2 31+2 31+2 31+2 30+2 29+2 32+2 32+2 32+2 29+2 23.0 52.0 52.0 43.0 36.0 39.0 32.0 20.0 25.0 40.0 41.0 39.0 38.0 40.0 52.0 41.0 47.0 43.0 67.0 42.0 47.0 16.0 46.0 33.0 43.0 42.0 22.0 15.0 19.0 10.0 9.0 9.0 5.0 12.0 €113K
18204 241638 B. Worman 16 https://cdn.sofifa.org/players/4/19/241638.png England https://cdn.sofifa.org/flags/14.png 47 67 Cambridge United https://cdn.sofifa.org/teams/2/light/1944.png €60K €1K 1189 Right 1.0 3.0 2.0 Medium/ Medium Normal No ST 33.0 Jul 1, 2017 NaN 2021 5'8 148lbs 45+2 45+2 45+2 45+2 46+2 46+2 46+2 45+2 44+2 44+2 44+2 44+2 38+2 38+2 38+2 44+2 34+2 30+2 30+2 30+2 34+2 33+2 28+2 28+2 28+2 33+2 25.0 40.0 46.0 38.0 38.0 45.0 38.0 27.0 28.0 44.0 70.0 69.0 50.0 47.0 58.0 45.0 60.0 55.0 32.0 45.0 32.0 15.0 48.0 43.0 55.0 41.0 32.0 13.0 11.0 6.0 5.0 10.0 6.0 13.0 €165K
18205 246268 D. Walker-Rice 17 https://cdn.sofifa.org/players/4/19/246268.png England https://cdn.sofifa.org/flags/14.png 47 66 Tranmere Rovers https://cdn.sofifa.org/teams/2/light/15048.png €60K €1K 1228 Right 1.0 3.0 2.0 Medium/ Medium Lean No RW 34.0 Apr 24, 2018 NaN 2019 5'10 154lbs 47+2 47+2 47+2 47+2 46+2 46+2 46+2 47+2 45+2 45+2 45+2 46+2 39+2 39+2 39+2 46+2 36+2 32+2 32+2 32+2 36+2 35+2 31+2 31+2 31+2 35+2 44.0 50.0 39.0 42.0 40.0 51.0 34.0 32.0 32.0 52.0 61.0 60.0 52.0 21.0 71.0 64.0 42.0 40.0 48.0 34.0 33.0 22.0 44.0 47.0 50.0 46.0 20.0 25.0 27.0 14.0 6.0 14.0 8.0 9.0 €143K
18206 246269 G. Nugent 16 https://cdn.sofifa.org/players/4/19/246269.png England https://cdn.sofifa.org/flags/14.png 46 66 Tranmere Rovers https://cdn.sofifa.org/teams/2/light/15048.png €60K €1K 1321 Right 1.0 3.0 2.0 Medium/ Medium Lean No CM 33.0 Oct 30, 2018 NaN 2019 5'10 176lbs 43+2 43+2 43+2 45+2 44+2 44+2 44+2 45+2 45+2 45+2 45+2 46+2 45+2 45+2 45+2 46+2 46+2 46+2 46+2 46+2 46+2 46+2 47+2 47+2 47+2 46+2 41.0 34.0 46.0 48.0 30.0 43.0 40.0 34.0 44.0 51.0 57.0 55.0 55.0 51.0 63.0 43.0 62.0 47.0 60.0 32.0 56.0 42.0 34.0 49.0 33.0 43.0 40.0 43.0 50.0 10.0 15.0 9.0 12.0 9.0 €165K

18207 rows × 88 columns

Cleanup

The dataset has some information that either cannot be analyzed or needs to be changed

Removed

  • Photo
  • Flag
  • Club Logo

Changed

  • Value
  • Wage
  • Release Clause
  • Preferred Foot
  • Height
  • Weight

Changes

Value, Wage, Release Clause

Each value of column Value, Wage, Release Clause, x = df.loc[:,['Value|Wage|Release Clause']] has format: €x[M,K].
The character is removed and depending on M or K the value is changed.
Ex: €110.5M -> 110500000 | €260K -> 260000

## Applying the changes for Value, Wage and Release Clause

arr = ['Value','Wage', 'Release Clause']
for x in arr:
    df[x] = df[x].str.strip('€')
    df[x] = df[x].str.translate(str.maketrans({'.':'','K':'000','M':'000000'}))
    df[x] = df[x].fillna("0")
    df[x] = pd.to_numeric(df[x])

Preferred Foot

The values Right and left, and null are changed to 0, 1, and 2
Right -> 0
Left -> 1
null -> 2

## Right -> 0, Left -> 1
df['Preferred Foot'] = df['Preferred Foot'].str.replace("Right","0")
df['Preferred Foot'] = df['Preferred Foot'].str.replace("Left","1")
## Changing null values to 2
df['Preferred Foot'] = df['Preferred Foot'].fillna("2")
df['Preferred Foot'] = pd.to_numeric(df['Preferred Foot'])

Height

The height is transformed to a readable numerical value 5'11 -> 5.11
Null value changed with the average value ~5.8

df['Height'] = df['Height'].str.translate(str.maketrans({"'":"."}))
df['Height'] = pd.to_numeric(df['Height'])
df['Height'] = df['Height'].fillna(df.Height.mean())
df['Height'].describe()
count    18207.000000
mean         5.797367
std          0.447641
min          5.100000
25%          5.110000
50%          5.900000
75%          6.100000
max          6.900000
Name: Height, dtype: float64

Weight

The characters lbs are removed 158lbs -> 158

df['Weight'] = ((df['Weight'].str.strip('lbs')))
df['Weight'] = pd.to_numeric(df['Weight'])
df['Weight']
0        159.0
1        183.0
2        150.0
3        168.0
4        154.0
         ...  
18202    134.0
18203    170.0
18204    148.0
18205    154.0
18206    176.0
Name: Weight, Length: 18207, dtype: float64

Photo, Flag, Club Logo

df = df.drop(columns=['Photo', 'Flag', 'Club Logo'])

Average age of the players

The method describe() can be used in this case. More specifically, invoking mean() on the the dataframe column Age returns the average age of the players: 25.122206

df.describe()
>> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
ID Age Overall Potential Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Jersey Number Height Weight 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
count 18207.000000 18207.000000 18207.000000 18207.000000 1.820700e+04 18207.000000 18207.000000 18207.000000 18159.000000 18159.000000 18159.000000 18147.000000 18207.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 1.820700e+04
mean 214298.338606 25.122206 66.238699 71.307299 1.362983e+07 9731.312133 1597.809908 0.236557 1.113222 2.947299 2.361308 19.546096 5.797367 165.979129 49.734181 45.550911 52.298144 58.686712 42.909026 55.371001 47.170824 42.863153 52.711933 58.369459 64.614076 64.726967 63.503607 61.836610 63.966573 55.460047 65.089432 63.219946 65.311967 47.109973 55.868991 46.698276 49.958478 53.400903 48.548598 58.648274 47.281623 47.697836 45.661435 16.616223 16.391596 16.232061 16.388898 16.710887 3.620049e+07
std 29965.244204 4.669943 6.908930 6.136496 3.987587e+07 21999.290406 272.586016 0.431139 0.394031 0.660456 0.756164 15.947765 0.447641 15.593344 18.364524 19.525820 17.379909 14.699495 17.694408 18.910371 18.395264 17.478763 15.327870 16.686595 14.927780 14.649953 14.766049 9.010464 14.136166 17.237958 11.820044 15.894741 12.557000 19.260524 17.367967 20.696909 19.529036 14.146881 15.704053 11.436133 19.904397 21.664004 21.289135 17.695349 16.906900 16.502864 17.034669 17.955119 1.033686e+08
min 16.000000 16.000000 46.000000 48.000000 0.000000e+00 0.000000 731.000000 0.000000 1.000000 1.000000 1.000000 1.000000 5.100000 110.000000 5.000000 2.000000 4.000000 7.000000 4.000000 4.000000 6.000000 3.000000 9.000000 5.000000 12.000000 12.000000 14.000000 21.000000 16.000000 2.000000 15.000000 12.000000 17.000000 3.000000 11.000000 3.000000 2.000000 10.000000 5.000000 3.000000 3.000000 2.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000e+00
25% 200315.500000 21.000000 62.000000 67.000000 3.000000e+05 1000.000000 1457.000000 0.000000 1.000000 3.000000 2.000000 8.000000 5.110000 154.000000 38.000000 30.000000 44.000000 54.000000 30.000000 49.000000 34.000000 31.000000 43.000000 54.000000 57.000000 57.000000 55.000000 56.000000 56.000000 45.000000 58.000000 56.000000 58.000000 33.000000 44.000000 26.000000 38.000000 44.000000 39.000000 51.000000 30.000000 27.000000 24.000000 8.000000 8.000000 8.000000 8.000000 8.000000 3.920000e+05
50% 221759.000000 25.000000 66.000000 71.000000 6.750000e+05 3000.000000 1635.000000 0.000000 1.000000 3.000000 2.000000 17.000000 5.900000 165.000000 54.000000 49.000000 56.000000 62.000000 44.000000 61.000000 48.000000 41.000000 56.000000 63.000000 67.000000 67.000000 66.000000 62.000000 66.000000 59.000000 66.000000 66.000000 67.000000 51.000000 59.000000 52.000000 55.000000 55.000000 49.000000 60.000000 53.000000 55.000000 52.000000 11.000000 11.000000 11.000000 11.000000 11.000000 1.000000e+06
75% 236529.500000 28.000000 71.000000 75.000000 1.300000e+07 9000.000000 1787.000000 0.000000 1.000000 3.000000 3.000000 26.000000 6.100000 176.000000 64.000000 62.000000 64.000000 68.000000 57.000000 68.000000 62.000000 57.000000 64.000000 69.000000 75.000000 75.000000 74.000000 68.000000 74.000000 68.000000 73.000000 74.000000 74.000000 62.000000 69.000000 64.000000 64.000000 64.000000 60.000000 67.000000 64.000000 66.000000 64.000000 14.000000 14.000000 14.000000 14.000000 14.000000 2.400000e+07
max 246620.000000 45.000000 94.000000 95.000000 1.185000e+09 565000.000000 2346.000000 2.000000 5.000000 5.000000 5.000000 99.000000 6.900000 243.000000 93.000000 95.000000 94.000000 93.000000 90.000000 97.000000 94.000000 94.000000 93.000000 96.000000 97.000000 96.000000 96.000000 96.000000 96.000000 95.000000 95.000000 96.000000 97.000000 94.000000 95.000000 92.000000 95.000000 94.000000 92.000000 96.000000 94.000000 93.000000 91.000000 90.000000 92.000000 91.000000 90.000000 94.000000 2.281000e+09
df.Age.mean()
25.122205745043114

Name of the oldest player

The name of the oldest player can be found with the method loc() by leveraging the output from of max() with a conditional statement. The Name is return with by specifying the Name column: O. Pérez

## Finding the name of the oldest player with conditional statement
## The max value for df.Age.max() is 45
(df.loc[df['Age'] == df.Age.max()])['Name']
4741    O. Pérez
Name: Name, dtype: object

The highest salary

The Wage column holds the data needed for finding the player's salary. Analyzing the data type of the different columns with the method info(), shows that Wage is interpreted as an object.
The method head() shows that the characters and K prevent the column data from being interpreted as a numerical value.
The method strip() is used to remove the characters and K, and the method astype() is used to cast the output to integer.
The methods describe() and max() are ultimately used to find the highest salary: €565K

df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 18207 entries, 0 to 18206
Data columns (total 85 columns):
 #   Column                    Non-Null Count  Dtype  
---  ------                    --------------  -----  
 0   ID                        18207 non-null  int64  
 1   Name                      18207 non-null  object 
 2   Age                       18207 non-null  int64  
 3   Nationality               18207 non-null  object 
 4   Overall                   18207 non-null  int64  
 5   Potential                 18207 non-null  int64  
 6   Club                      17966 non-null  object 
 7   Value                     18207 non-null  int64  
 8   Wage                      18207 non-null  int64  
 9   Special                   18207 non-null  int64  
 10  Preferred Foot            18207 non-null  int64  
 11  International Reputation  18159 non-null  float64
 12  Weak Foot                 18159 non-null  float64
 13  Skill Moves               18159 non-null  float64
 14  Work Rate                 18159 non-null  object 
 15  Body Type                 18159 non-null  object 
 16  Real Face                 18159 non-null  object 
 17  Position                  18147 non-null  object 
 18  Jersey Number             18147 non-null  float64
 19  Joined                    16654 non-null  object 
 20  Loaned From               1264 non-null   object 
 21  Contract Valid Until      17918 non-null  object 
 22  Height                    18207 non-null  float64
 23  Weight                    18159 non-null  float64
 24  LS                        16122 non-null  object 
 25  ST                        16122 non-null  object 
 26  RS                        16122 non-null  object 
 27  LW                        16122 non-null  object 
 28  LF                        16122 non-null  object 
 29  CF                        16122 non-null  object 
 30  RF                        16122 non-null  object 
 31  RW                        16122 non-null  object 
 32  LAM                       16122 non-null  object 
 33  CAM                       16122 non-null  object 
 34  RAM                       16122 non-null  object 
 35  LM                        16122 non-null  object 
 36  LCM                       16122 non-null  object 
 37  CM                        16122 non-null  object 
 38  RCM                       16122 non-null  object 
 39  RM                        16122 non-null  object 
 40  LWB                       16122 non-null  object 
 41  LDM                       16122 non-null  object 
 42  CDM                       16122 non-null  object 
 43  RDM                       16122 non-null  object 
 44  RWB                       16122 non-null  object 
 45  LB                        16122 non-null  object 
 46  LCB                       16122 non-null  object 
 47  CB                        16122 non-null  object 
 48  RCB                       16122 non-null  object 
 49  RB                        16122 non-null  object 
 50  Crossing                  18159 non-null  float64
 51  Finishing                 18159 non-null  float64
 52  HeadingAccuracy           18159 non-null  float64
 53  ShortPassing              18159 non-null  float64
 54  Volleys                   18159 non-null  float64
 55  Dribbling                 18159 non-null  float64
 56  Curve                     18159 non-null  float64
 57  FKAccuracy                18159 non-null  float64
 58  LongPassing               18159 non-null  float64
 59  BallControl               18159 non-null  float64
 60  Acceleration              18159 non-null  float64
 61  SprintSpeed               18159 non-null  float64
 62  Agility                   18159 non-null  float64
 63  Reactions                 18159 non-null  float64
 64  Balance                   18159 non-null  float64
 65  ShotPower                 18159 non-null  float64
 66  Jumping                   18159 non-null  float64
 67  Stamina                   18159 non-null  float64
 68  Strength                  18159 non-null  float64
 69  LongShots                 18159 non-null  float64
 70  Aggression                18159 non-null  float64
 71  Interceptions             18159 non-null  float64
 72  Positioning               18159 non-null  float64
 73  Vision                    18159 non-null  float64
 74  Penalties                 18159 non-null  float64
 75  Composure                 18159 non-null  float64
 76  Marking                   18159 non-null  float64
 77  StandingTackle            18159 non-null  float64
 78  SlidingTackle             18159 non-null  float64
 79  GKDiving                  18159 non-null  float64
 80  GKHandling                18159 non-null  float64
 81  GKKicking                 18159 non-null  float64
 82  GKPositioning             18159 non-null  float64
 83  GKReflexes                18159 non-null  float64
 84  Release Clause            18207 non-null  int64  
dtypes: float64(40), int64(9), object(36)
memory usage: 11.9+ MB
## Removing the characters with strip() and casting the output to int with astype()
## The highest salary is found with describe()
df['Wage'].describe()
count     18207.000000
mean       9731.312133
std       21999.290406
min           0.000000
25%        1000.000000
50%        3000.000000
75%        9000.000000
max      565000.000000
Name: Wage, dtype: float64
## The max value can also be found with max()
df['Wage'].max()
565000

Histogram

Few things can be noticed from the histograms.

df.hist(figsize=(35,25));

png

Age

The Age histogram is skewed to the left, indicating most of the players are between 20 and 30 years old

df.hist(column=["Age"]);

png

Preferred Foot

Most of the players prefer the Right foot

df.hist(column=["Preferred Foot"]);

png

Acceleration, SprintSpeed, Agility

These three histograms present a similar distribution. Normally these three skills are related.

df.hist(column=["Acceleration", "SprintSpeed", "Agility"], figsize=(25,15));

png

Ball Control and Dribbling

The distribution and the outliers are very similar. The similar outliers highlights how ball control and dribbling skills are related.

df.hist(column=["BallControl", "Dribbling"], figsize=(25,15));

png

Correlation

df_corr = df.corr()
df_corr
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
ID Age Overall Potential Value Wage Special Preferred Foot International Reputation Weak Foot Skill Moves Jersey Number Height Weight 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
ID 1.000000 -0.739208 -0.417025 0.047074 -0.106880 -0.204610 -0.231352 0.003771 -0.356191 -0.075784 -0.056914 0.182074 -0.054103 -0.191425 -0.131994 -0.082323 -0.106815 -0.136279 -0.159915 -0.030340 -0.169511 -0.199549 -0.186764 -0.100184 0.133236 0.132437 -0.019897 -0.408617 0.048463 -0.166133 -0.169369 -0.053895 -0.259756 -0.161549 -0.228329 -0.160602 -0.088330 -0.215170 -0.140657 -0.384473 -0.110198 -0.085929 -0.068409 -0.105594 -0.111149 -0.106652 -0.118250 -0.105778 -0.114893
Age -0.739208 1.000000 0.452350 -0.253312 0.058848 0.141145 0.236695 -0.002846 0.253765 0.059867 0.027649 -0.241156 0.053174 0.230213 0.130545 0.068660 0.147183 0.132894 0.142472 0.010166 0.143276 0.193467 0.181310 0.084969 -0.158667 -0.151682 -0.019395 0.453124 -0.089877 0.156947 0.177167 0.097793 0.332798 0.155096 0.265190 0.197845 0.082443 0.187422 0.139535 0.391023 0.142817 0.119745 0.103089 0.101277 0.106419 0.104964 0.116402 0.103313 0.057294
Overall -0.417025 0.452350 1.000000 0.660939 0.499790 0.571926 0.606960 0.036196 0.499491 0.212015 0.414463 -0.218931 0.040774 0.154634 0.394972 0.332515 0.340776 0.502550 0.391338 0.372426 0.419491 0.396892 0.483909 0.460197 0.196869 0.210647 0.264952 0.850045 0.103160 0.441118 0.264435 0.365656 0.349326 0.420795 0.395470 0.321326 0.356493 0.498894 0.341429 0.727655 0.286505 0.252629 0.222811 -0.025937 -0.025062 -0.029372 -0.017674 -0.023276 0.562588
Potential 0.047074 -0.253312 0.660939 1.000000 0.457905 0.486413 0.383727 0.028867 0.372993 0.162346 0.354290 -0.010474 0.013914 -0.006947 0.246319 0.243355 0.200988 0.369189 0.254906 0.315019 0.279944 0.230544 0.321437 0.354396 0.234608 0.236771 0.222310 0.513425 0.138025 0.288318 0.109151 0.202563 0.075769 0.266740 0.171174 0.154908 0.245616 0.348141 0.224281 0.440008 0.162801 0.143564 0.128980 -0.053446 -0.054672 -0.059061 -0.052589 -0.053341 0.525832
Value -0.106880 0.058848 0.499790 0.457905 1.000000 0.623611 0.310190 0.009475 0.454649 0.134772 0.264022 -0.075694 0.008694 0.033088 0.211863 0.209650 0.152528 0.271076 0.235255 0.228060 0.241345 0.221563 0.252284 0.257700 0.142778 0.143827 0.161905 0.431399 0.095574 0.234275 0.083713 0.175257 0.098425 0.235310 0.149122 0.118884 0.214564 0.291482 0.194791 0.366372 0.113887 0.094844 0.077349 -0.033054 -0.031571 -0.031964 -0.031807 -0.033406 0.694382
Wage -0.204610 0.141145 0.571926 0.486413 0.623611 1.000000 0.347835 0.010576 0.668635 0.140849 0.263205 -0.086561 0.023286 0.064776 0.232834 0.217439 0.187967 0.296691 0.257357 0.237150 0.259550 0.236385 0.276762 0.277615 0.124985 0.130315 0.156287 0.495560 0.088873 0.258351 0.129691 0.177562 0.139360 0.249084 0.194581 0.157415 0.226775 0.315395 0.222440 0.419597 0.145594 0.126291 0.111025 -0.025595 -0.025177 -0.028325 -0.025489 -0.025992 0.787085
Special -0.231352 0.236695 0.606960 0.383727 0.310190 0.347835 1.000000 0.122518 0.292208 0.341855 0.763412 -0.133716 -0.295836 -0.267830 0.866417 0.724244 0.644421 0.906729 0.773974 0.874274 0.851900 0.806414 0.846302 0.912107 0.654337 0.645963 0.699673 0.597169 0.586788 0.835277 0.321846 0.792762 0.192990 0.840049 0.666236 0.561676 0.824307 0.761992 0.734533 0.752331 0.561866 0.538802 0.506968 -0.674637 -0.673625 -0.670254 -0.668272 -0.673238 0.332148
Preferred Foot 0.003771 -0.002846 0.036196 0.028867 0.009475 0.010576 0.122518 1.000000 -0.001914 -0.072325 0.109496 -0.018032 -0.043386 -0.073749 0.207002 0.041634 0.043197 0.102362 0.052706 0.132130 0.160309 0.150728 0.108396 0.116102 0.119571 0.118210 0.109280 0.026705 0.098055 0.074045 -0.020562 0.092773 -0.039058 0.080111 0.057480 0.101602 0.093108 0.062553 0.060223 0.056024 0.102301 0.110979 0.120486 -0.102638 -0.103829 -0.104356 -0.104633 -0.103949 0.008330
International Reputation -0.356191 0.253765 0.499491 0.372993 0.454649 0.668635 0.292208 -0.001914 1.000000 0.128317 0.208153 -0.077298 0.028510 0.088340 0.191770 0.178373 0.157483 0.242803 0.243089 0.179041 0.233681 0.223564 0.239525 0.217946 0.044319 0.044070 0.100869 0.445614 0.050076 0.227772 0.120931 0.094780 0.131280 0.213960 0.173327 0.129586 0.183003 0.284600 0.218620 0.392787 0.115208 0.092846 0.079176 0.004526 0.003942 0.000651 0.006904 0.003444 0.579212
Weak Foot -0.075784 0.059867 0.212015 0.162346 0.134772 0.140849 0.341855 -0.072325 0.128317 1.000000 0.340721 -0.035410 -0.122047 -0.130724 0.307925 0.357416 0.183238 0.322133 0.357340 0.352658 0.345468 0.330472 0.277174 0.356383 0.261435 0.248822 0.302062 0.201341 0.254022 0.332855 0.069752 0.232094 -0.008470 0.355967 0.131524 0.053097 0.346896 0.337897 0.330252 0.278132 0.065673 0.042646 0.026105 -0.231905 -0.233098 -0.229395 -0.231298 -0.232574 0.142225
Skill Moves -0.056914 0.027649 0.414463 0.354290 0.264022 0.263205 0.763412 0.109496 0.208153 0.340721 1.000000 -0.035194 -0.301805 -0.351209 0.741035 0.743439 0.443005 0.730363 0.745077 0.839757 0.771052 0.701068 0.622342 0.818051 0.652356 0.624098 0.681765 0.377044 0.578459 0.718237 0.107553 0.570226 -0.041475 0.752980 0.347795 0.209604 0.781248 0.674057 0.690434 0.586836 0.241428 0.210517 0.178607 -0.621675 -0.619755 -0.616990 -0.618853 -0.621925 0.274604
Jersey Number 0.182074 -0.241156 -0.218931 -0.010474 -0.075694 -0.086561 -0.133716 -0.018032 -0.077298 -0.035410 -0.035194 1.000000 -0.023435 -0.087319 -0.076585 -0.006639 -0.091688 -0.100241 -0.026731 -0.028021 -0.055428 -0.068843 -0.117424 -0.073210 -0.004395 -0.015069 -0.034158 -0.192622 0.008009 -0.053860 -0.104179 -0.127822 -0.158411 -0.046174 -0.146907 -0.158526 -0.025422 -0.078050 -0.028023 -0.167523 -0.142474 -0.133285 -0.124610 0.004807 0.001543 0.001162 -0.002736 0.003255 -0.087608
Height -0.054103 0.053174 0.040774 0.013914 0.008694 0.023286 -0.295836 -0.043386 0.028510 -0.122047 -0.301805 -0.023435 1.000000 0.451535 -0.368309 -0.279658 -0.049551 -0.275337 -0.265432 -0.361843 -0.326768 -0.299573 -0.247482 -0.311275 -0.380082 -0.326244 -0.408780 -0.016399 -0.494316 -0.227042 -0.057926 -0.236818 0.288265 -0.290521 -0.068753 -0.072856 -0.335176 -0.271443 -0.259990 -0.098100 -0.083355 -0.076717 -0.081207 0.283029 0.283273 0.278904 0.282880 0.284345 0.009536
Weight -0.191425 0.230213 0.154634 -0.006947 0.033088 0.064776 -0.267830 -0.073749 0.088340 -0.130724 -0.351209 -0.087319 0.451535 1.000000 -0.393323 -0.292407 0.035956 -0.290366 -0.262884 -0.414228 -0.345941 -0.305175 -0.260863 -0.337702 -0.477853 -0.410936 -0.534264 0.086364 -0.663905 -0.191950 0.010857 -0.223317 0.615798 -0.278069 0.032396 -0.025339 -0.350330 -0.284113 -0.253387 -0.034444 -0.049356 -0.046835 -0.056164 0.340034 0.339024 0.337717 0.342178 0.341135 0.034893
Crossing -0.131994 0.130545 0.394972 0.246319 0.211863 0.232834 0.866417 0.207002 0.191770 0.307925 0.741035 -0.076585 -0.368309 -0.393323 1.000000 0.655300 0.469507 0.809660 0.690339 0.856647 0.833105 0.761107 0.756527 0.840916 0.668365 0.645578 0.698320 0.389574 0.618280 0.705503 0.135486 0.672633 -0.029403 0.742065 0.473570 0.427739 0.783185 0.684948 0.645805 0.575446 0.443101 0.428963 0.409961 -0.663053 -0.660193 -0.659767 -0.660160 -0.662539 0.217514
Finishing -0.082323 0.068660 0.332515 0.243355 0.209650 0.217439 0.724244 0.041634 0.178373 0.357416 0.743439 -0.006639 -0.279658 -0.292407 0.655300 1.000000 0.473427 0.661830 0.882675 0.824337 0.759229 0.697550 0.512806 0.788376 0.606378 0.593864 0.644273 0.331376 0.523787 0.815472 0.097464 0.510891 -0.009744 0.877834 0.242825 -0.020703 0.888790 0.697290 0.837827 0.533414 0.024218 -0.033023 -0.071811 -0.588752 -0.587145 -0.583268 -0.584852 -0.586913 0.217351
HeadingAccuracy -0.106815 0.147183 0.340776 0.200988 0.152528 0.187967 0.644421 0.043197 0.157483 0.183238 0.443005 -0.091688 -0.049551 0.035956 0.469507 0.473427 1.000000 0.640091 0.505639 0.550750 0.440846 0.407772 0.510779 0.658175 0.329647 0.379453 0.260514 0.325867 0.168834 0.611736 0.380041 0.634589 0.486903 0.506814 0.692847 0.548689 0.533818 0.275673 0.551978 0.507208 0.583123 0.561063 0.533643 -0.750417 -0.749888 -0.746444 -0.744443 -0.748895 0.159469
ShortPassing -0.136279 0.132894 0.502550 0.369189 0.271076 0.296691 0.906729 0.102362 0.242803 0.322133 0.730363 -0.100241 -0.275337 -0.290366 0.809660 0.661830 0.640091 1.000000 0.698309 0.843722 0.775398 0.736659 0.895722 0.911451 0.565752 0.554681 0.612899 0.483028 0.533126 0.771845 0.197535 0.716659 0.133831 0.761750 0.611570 0.543350 0.757776 0.713524 0.676063 0.685137 0.559576 0.541131 0.508644 -0.729785 -0.728024 -0.724381 -0.723782 -0.728721 0.290176
Volleys -0.159915 0.142472 0.391338 0.254906 0.235255 0.257357 0.773974 0.052706 0.243089 0.357340 0.745077 -0.026731 -0.265432 -0.262884 0.690339 0.882675 0.505639 0.698309 1.000000 0.809639 0.807285 0.749637 0.571050 0.794935 0.572064 0.556955 0.624995 0.393713 0.513682 0.832479 0.126228 0.527395 0.029505 0.868253 0.330116 0.088385 0.848333 0.699471 0.829257 0.595281 0.120919 0.072788 0.035457 -0.590808 -0.588668 -0.584954 -0.586131 -0.588670 0.240956
Dribbling -0.030340 0.010166 0.372426 0.315019 0.228060 0.237150 0.874274 0.132130 0.179041 0.352658 0.839757 -0.028021 -0.361843 -0.414228 0.856647 0.824337 0.550750 0.843722 0.809639 1.000000 0.842652 0.753600 0.722465 0.938942 0.748292 0.726835 0.765153 0.369265 0.663086 0.804732 0.143079 0.686511 -0.033550 0.843619 0.441075 0.296020 0.896932 0.730150 0.769594 0.597498 0.336072 0.301251 0.273963 -0.754625 -0.753181 -0.749816 -0.751348 -0.754341 0.235479
Curve -0.169511 0.143276 0.419491 0.279944 0.241345 0.259550 0.851900 0.160309 0.233681 0.345468 0.771052 -0.055428 -0.326768 -0.345941 0.833105 0.759229 0.440846 0.775398 0.807285 0.842652 1.000000 0.861277 0.710807 0.829568 0.607239 0.578628 0.682104 0.413413 0.586969 0.792143 0.111934 0.590381 -0.035587 0.835309 0.399332 0.273756 0.811082 0.744774 0.751833 0.616532 0.289529 0.261481 0.232869 -0.606286 -0.603141 -0.600266 -0.603540 -0.604960 0.248018
FKAccuracy -0.199549 0.193467 0.396892 0.230544 0.221563 0.236385 0.806414 0.150728 0.223564 0.330472 0.701068 -0.068843 -0.299573 -0.305175 0.761107 0.697550 0.407772 0.736659 0.749637 0.753600 0.861277 1.000000 0.703544 0.759548 0.498215 0.466686 0.590159 0.398242 0.521513 0.754413 0.082026 0.537477 -0.018669 0.802667 0.396068 0.295357 0.729506 0.717173 0.734440 0.585120 0.297976 0.279153 0.247903 -0.556605 -0.553644 -0.549911 -0.552641 -0.554920 0.227925
LongPassing -0.186764 0.181310 0.483909 0.321437 0.252284 0.276762 0.846302 0.108396 0.239525 0.277174 0.622342 -0.117424 -0.247482 -0.260863 0.756527 0.512806 0.510779 0.895722 0.571050 0.722465 0.710807 0.703544 1.000000 0.788650 0.442566 0.426586 0.523426 0.461527 0.462300 0.671426 0.154740 0.635627 0.114448 0.667847 0.590522 0.596821 0.614498 0.698199 0.542247 0.645797 0.587106 0.587430 0.562230 -0.596820 -0.594999 -0.591453 -0.591561 -0.595887 0.269962
BallControl -0.100184 0.084969 0.460197 0.354396 0.257700 0.277615 0.912107 0.116102 0.217946 0.356383 0.818051 -0.073210 -0.311275 -0.337702 0.840916 0.788376 0.658175 0.911451 0.794935 0.938942 0.829568 0.759548 0.788650 1.000000 0.675737 0.663990 0.704604 0.443750 0.600908 0.831287 0.195235 0.728604 0.087841 0.836047 0.549840 0.418584 0.863915 0.718411 0.769791 0.674881 0.452705 0.417566 0.384802 -0.788444 -0.786797 -0.783423 -0.783607 -0.787939 0.269669
Acceleration 0.133236 -0.158667 0.196869 0.234608 0.142778 0.124985 0.654337 0.119571 0.044319 0.261435 0.652356 -0.004395 -0.380082 -0.477853 0.668365 0.606378 0.329647 0.565752 0.572064 0.748292 0.607239 0.498215 0.442566 0.675737 1.000000 0.921928 0.810832 0.188685 0.711466 0.539515 0.215221 0.607240 -0.166507 0.579948 0.250186 0.152146 0.682309 0.461552 0.532908 0.347427 0.195369 0.163000 0.157565 -0.593008 -0.594866 -0.592127 -0.592143 -0.593201 0.150723
SprintSpeed 0.132437 -0.151682 0.210647 0.236771 0.143827 0.130315 0.645963 0.118210 0.044070 0.248822 0.624098 -0.015069 -0.326244 -0.410936 0.645578 0.593864 0.379453 0.554681 0.556955 0.726835 0.578628 0.466686 0.426586 0.663990 0.921928 1.000000 0.763623 0.192402 0.643505 0.544640 0.232372 0.619919 -0.083206 0.561240 0.278364 0.164031 0.665239 0.429554 0.521071 0.351607 0.212575 0.178214 0.171980 -0.597677 -0.599694 -0.597320 -0.596498 -0.597837 0.154334
Agility -0.019897 -0.019395 0.264952 0.222310 0.161905 0.156287 0.699673 0.109280 0.100869 0.302062 0.681765 -0.034158 -0.408780 -0.534264 0.698320 0.644273 0.260514 0.612899 0.624995 0.765153 0.682104 0.590159 0.523426 0.704604 0.810832 0.763623 1.000000 0.275893 0.770506 0.574020 0.214917 0.568706 -0.234199 0.645085 0.240699 0.138893 0.708151 0.597327 0.566175 0.432511 0.167122 0.129204 0.116686 -0.527756 -0.528482 -0.527164 -0.526983 -0.528899 0.169361
Reactions -0.408617 0.453124 0.850045 0.513425 0.431399 0.495560 0.597169 0.026705 0.445614 0.201341 0.377044 -0.192622 -0.016399 0.086364 0.389574 0.331376 0.325867 0.483028 0.393713 0.369265 0.413413 0.398242 0.461527 0.443750 0.188685 0.192402 0.275893 1.000000 0.149670 0.418361 0.254131 0.369347 0.285813 0.421649 0.402974 0.338155 0.386476 0.502536 0.346143 0.685558 0.283607 0.255399 0.228355 -0.062967 -0.061940 -0.065927 -0.055031 -0.059961 0.486208
Balance 0.048463 -0.089877 0.103160 0.138025 0.095574 0.088873 0.586788 0.098055 0.050076 0.254022 0.578459 0.008009 -0.494316 -0.663905 0.618280 0.523787 0.168834 0.533126 0.513682 0.663086 0.586969 0.521513 0.462300 0.600908 0.711466 0.643505 0.770506 0.149670 1.000000 0.458608 0.188489 0.474932 -0.390841 0.533349 0.184140 0.150289 0.596091 0.491626 0.482794 0.310763 0.178695 0.154045 0.152470 -0.504727 -0.506102 -0.503970 -0.503652 -0.505974 0.102419
ShotPower -0.166133 0.156947 0.441118 0.288318 0.234275 0.258351 0.835277 0.074045 0.227772 0.332855 0.718237 -0.053860 -0.227042 -0.191950 0.705503 0.815472 0.611736 0.771845 0.832479 0.804732 0.792143 0.754413 0.671426 0.831287 0.539515 0.544640 0.574020 0.418361 0.458608 1.000000 0.185823 0.616385 0.169515 0.889254 0.491386 0.265125 0.809068 0.680335 0.795220 0.634495 0.296944 0.256403 0.220237 -0.654117 -0.654099 -0.649403 -0.651409 -0.653475 0.240140
Jumping -0.169369 0.177167 0.264435 0.109151 0.083713 0.129691 0.321846 -0.020562 0.120931 0.069752 0.107553 -0.104179 -0.057926 0.010857 0.135486 0.097464 0.380041 0.197535 0.126228 0.143079 0.111934 0.082026 0.154740 0.195235 0.215221 0.232372 0.214917 0.254131 0.188489 0.185823 1.000000 0.345968 0.284021 0.135932 0.373281 0.289043 0.143678 0.059931 0.133294 0.252353 0.279196 0.260645 0.260261 -0.192700 -0.193692 -0.195282 -0.189079 -0.192050 0.108904
Stamina -0.053895 0.097793 0.365656 0.202563 0.175257 0.177562 0.792762 0.092773 0.094780 0.232094 0.570226 -0.127822 -0.236818 -0.223317 0.672633 0.510891 0.634589 0.716659 0.527395 0.686511 0.590381 0.537477 0.635627 0.728604 0.607240 0.619919 0.568706 0.369347 0.474932 0.616385 0.345968 1.000000 0.262694 0.596110 0.645687 0.576353 0.640982 0.472335 0.516426 0.523112 0.587782 0.570055 0.544702 -0.701467 -0.698556 -0.696729 -0.696073 -0.699670 0.183974
Strength -0.259756 0.332798 0.349326 0.075769 0.098425 0.139360 0.192990 -0.039058 0.131280 -0.008470 -0.041475 -0.158411 0.288265 0.615798 -0.029403 -0.009744 0.486903 0.133831 0.029505 -0.033550 -0.035587 -0.018669 0.114448 0.087841 -0.166507 -0.083206 -0.234199 0.285813 -0.390841 0.169515 0.284021 0.262694 1.000000 0.050173 0.474120 0.356533 0.006923 -0.046929 0.054491 0.280522 0.333334 0.332159 0.304849 -0.111012 -0.109660 -0.110253 -0.103878 -0.107497 0.108956
LongShots -0.161549 0.155096 0.420795 0.266740 0.235310 0.249084 0.840049 0.080111 0.213960 0.355967 0.752980 -0.046174 -0.290521 -0.278069 0.742065 0.877834 0.506814 0.761750 0.868253 0.843619 0.835309 0.802667 0.667847 0.836047 0.579948 0.561240 0.645085 0.421649 0.533349 0.889254 0.135932 0.596110 0.050173 1.000000 0.392495 0.193814 0.861080 0.753701 0.812446 0.616102 0.215510 0.172331 0.133603 -0.612381 -0.610739 -0.605952 -0.607200 -0.610087 0.237264
Aggression -0.228329 0.265190 0.395470 0.171174 0.149122 0.194581 0.666236 0.057480 0.173327 0.131524 0.347795 -0.146907 -0.068753 0.032396 0.473570 0.242825 0.692847 0.611570 0.330116 0.441075 0.399332 0.396068 0.590522 0.549840 0.250186 0.278364 0.240699 0.402974 0.184140 0.491386 0.373281 0.645687 0.474120 0.392495 1.000000 0.751897 0.381700 0.300083 0.336089 0.515776 0.723961 0.744216 0.721384 -0.575843 -0.576114 -0.573607 -0.571201 -0.575142 0.163909
Interceptions -0.160602 0.197845 0.321326 0.154908 0.118884 0.157415 0.561676 0.101602 0.129586 0.053097 0.209604 -0.158526 -0.072856 -0.025339 0.427739 -0.020703 0.548689 0.543350 0.088385 0.296020 0.273756 0.295357 0.596821 0.418584 0.152146 0.164031 0.138893 0.338155 0.150289 0.265125 0.289043 0.576353 0.356533 0.193814 0.751897 1.000000 0.170970 0.183096 0.110834 0.397450 0.888349 0.941471 0.928282 -0.485585 -0.486324 -0.485394 -0.481279 -0.486036 0.133022
Positioning -0.088330 0.082443 0.356493 0.245616 0.214564 0.226775 0.824307 0.093108 0.183003 0.346896 0.781248 -0.025422 -0.335176 -0.350330 0.783185 0.888790 0.533818 0.757776 0.848333 0.896932 0.811082 0.729506 0.614498 0.863915 0.682309 0.665239 0.708151 0.386476 0.596091 0.809068 0.143678 0.640982 0.006923 0.861080 0.381700 0.170970 1.000000 0.734367 0.801268 0.580498 0.202597 0.158060 0.124228 -0.679480 -0.677699 -0.674393 -0.675569 -0.678582 0.219500
Vision -0.215170 0.187422 0.498894 0.348141 0.291482 0.315395 0.761992 0.062553 0.284600 0.337897 0.674057 -0.078050 -0.271443 -0.284113 0.684948 0.697290 0.275673 0.713524 0.699471 0.730150 0.744774 0.717173 0.698199 0.718411 0.461552 0.429554 0.597327 0.502536 0.491626 0.680335 0.059931 0.472335 -0.046929 0.753701 0.300083 0.183096 0.734367 1.000000 0.632927 0.636280 0.176760 0.146460 0.113228 -0.381899 -0.377807 -0.374737 -0.375775 -0.381158 0.313117
Penalties -0.140657 0.139535 0.341429 0.224281 0.194791 0.222440 0.734533 0.060223 0.218620 0.330252 0.690434 -0.028023 -0.259990 -0.253387 0.645805 0.837827 0.551978 0.676063 0.829257 0.769594 0.751833 0.734440 0.542247 0.769791 0.532908 0.521071 0.566175 0.346143 0.482794 0.795220 0.133294 0.516426 0.054491 0.812446 0.336089 0.110834 0.801268 0.632927 1.000000 0.551801 0.152296 0.101920 0.066693 -0.620069 -0.618968 -0.614006 -0.617074 -0.619099 0.201017
Composure -0.384473 0.391023 0.727655 0.440008 0.366372 0.419597 0.752331 0.056024 0.392787 0.278132 0.586836 -0.167523 -0.098100 -0.034444 0.575446 0.533414 0.507208 0.685137 0.595281 0.597498 0.616532 0.585120 0.645797 0.674881 0.347427 0.351607 0.432511 0.685558 0.310763 0.634495 0.252353 0.523112 0.280522 0.616102 0.515776 0.397450 0.580498 0.636280 0.551801 1.000000 0.384081 0.351726 0.317492 -0.378750 -0.375720 -0.374897 -0.370234 -0.377626 0.399369
Marking -0.110198 0.142817 0.286505 0.162801 0.113887 0.145594 0.561866 0.102301 0.115208 0.065673 0.241428 -0.142474 -0.083355 -0.049356 0.443101 0.024218 0.583123 0.559576 0.120919 0.336072 0.289529 0.297976 0.587106 0.452705 0.195369 0.212575 0.167122 0.283607 0.178695 0.296944 0.279196 0.587782 0.333334 0.215510 0.723961 0.888349 0.202597 0.176760 0.152296 0.384081 1.000000 0.906541 0.895908 -0.550978 -0.552263 -0.549498 -0.546670 -0.551290 0.124521
StandingTackle -0.085929 0.119745 0.252629 0.143564 0.094844 0.126291 0.538802 0.110979 0.092846 0.042646 0.210517 -0.133285 -0.076717 -0.046835 0.428963 -0.033023 0.561063 0.541131 0.072788 0.301251 0.261481 0.279153 0.587430 0.417566 0.163000 0.178214 0.129204 0.255399 0.154045 0.256403 0.260645 0.570055 0.332159 0.172331 0.744216 0.941471 0.158060 0.146460 0.101920 0.351726 0.906541 1.000000 0.974659 -0.530989 -0.532160 -0.531092 -0.527792 -0.531474 0.106268
SlidingTackle -0.068409 0.103089 0.222811 0.128980 0.077349 0.111025 0.506968 0.120486 0.079176 0.026105 0.178607 -0.124610 -0.081207 -0.056164 0.409961 -0.071811 0.533643 0.508644 0.035457 0.273963 0.232869 0.247903 0.562230 0.384802 0.157565 0.171980 0.116686 0.228355 0.152470 0.220237 0.260261 0.544702 0.304849 0.133603 0.721384 0.928282 0.124228 0.113228 0.066693 0.317492 0.895908 0.974659 1.000000 -0.509337 -0.510591 -0.509378 -0.505792 -0.509425 0.089027
GKDiving -0.105594 0.101277 -0.025937 -0.053446 -0.033054 -0.025595 -0.674637 -0.102638 0.004526 -0.231905 -0.621675 0.004807 0.283029 0.340034 -0.663053 -0.588752 -0.750417 -0.729785 -0.590808 -0.754625 -0.606286 -0.556605 -0.596820 -0.788444 -0.593008 -0.597677 -0.527756 -0.062967 -0.504727 -0.654117 -0.192700 -0.701467 -0.111012 -0.612381 -0.575843 -0.485585 -0.679480 -0.381899 -0.620069 -0.378750 -0.550978 -0.530989 -0.509337 1.000000 0.970280 0.965685 0.969864 0.973320 -0.021037
GKHandling -0.111149 0.106419 -0.025062 -0.054672 -0.031571 -0.025177 -0.673625 -0.103829 0.003942 -0.233098 -0.619755 0.001543 0.283273 0.339024 -0.660193 -0.587145 -0.749888 -0.728024 -0.588668 -0.753181 -0.603141 -0.553644 -0.594999 -0.786797 -0.594866 -0.599694 -0.528482 -0.061940 -0.506102 -0.654099 -0.193692 -0.698556 -0.109660 -0.610739 -0.576114 -0.486324 -0.677699 -0.377807 -0.618968 -0.375720 -0.552263 -0.532160 -0.510591 0.970280 1.000000 0.965239 0.969408 0.970264 -0.021648
GKKicking -0.106652 0.104964 -0.029372 -0.059061 -0.031964 -0.028325 -0.670254 -0.104356 0.000651 -0.229395 -0.616990 0.001162 0.278904 0.337717 -0.659767 -0.583268 -0.746444 -0.724381 -0.584954 -0.749816 -0.600266 -0.549911 -0.591453 -0.783423 -0.592127 -0.597320 -0.527164 -0.065927 -0.503970 -0.649403 -0.195282 -0.696729 -0.110253 -0.605952 -0.573607 -0.485394 -0.674393 -0.374737 -0.614006 -0.374897 -0.549498 -0.531092 -0.509378 0.965685 0.965239 1.000000 0.964336 0.966337 -0.022945
GKPositioning -0.118250 0.116402 -0.017674 -0.052589 -0.031807 -0.025489 -0.668272 -0.104633 0.006904 -0.231298 -0.618853 -0.002736 0.282880 0.342178 -0.660160 -0.584852 -0.744443 -0.723782 -0.586131 -0.751348 -0.603540 -0.552641 -0.591561 -0.783607 -0.592143 -0.596498 -0.526983 -0.055031 -0.503652 -0.651409 -0.189079 -0.696073 -0.103878 -0.607200 -0.571201 -0.481279 -0.675569 -0.375775 -0.617074 -0.370234 -0.546670 -0.527792 -0.505792 0.969864 0.969408 0.964336 1.000000 0.970130 -0.019560
GKReflexes -0.105778 0.103313 -0.023276 -0.053341 -0.033406 -0.025992 -0.673238 -0.103949 0.003444 -0.232574 -0.621925 0.003255 0.284345 0.341135 -0.662539 -0.586913 -0.748895 -0.728721 -0.588670 -0.754341 -0.604960 -0.554920 -0.595887 -0.787939 -0.593201 -0.597837 -0.528899 -0.059961 -0.505974 -0.653475 -0.192050 -0.699670 -0.107497 -0.610087 -0.575142 -0.486036 -0.678582 -0.381158 -0.619099 -0.377626 -0.551290 -0.531474 -0.509425 0.973320 0.970264 0.966337 0.970130 1.000000 -0.021371
Release Clause -0.114893 0.057294 0.562588 0.525832 0.694382 0.787085 0.332148 0.008330 0.579212 0.142225 0.274604 -0.087608 0.009536 0.034893 0.217514 0.217351 0.159469 0.290176 0.240956 0.235479 0.248018 0.227925 0.269962 0.269669 0.150723 0.154334 0.169361 0.486208 0.102419 0.240140 0.108904 0.183974 0.108956 0.237264 0.163909 0.133022 0.219500 0.313117 0.201017 0.399369 0.124521 0.106268 0.089027 -0.021037 -0.021648 -0.022945 -0.019560 -0.021371 1.000000

Positive Correlations

Ball Control has different positive correlations. Some of the highest are Dribbling, ShortPassing, and Crossing which makes sense as these three skills are heavily based on ball control.
Volleys has positive correlations with Finishing, Positioning, and Longshots. These correlations make sense as mostly volleys in football occur when trying score; they require good positions as the ball might come fast; in order to make good longshots for scoring it's better to take advantage of the momentum of the ball.

Negative Correlations

Balance has negative correlations with Weight and Strength. The correlation with Weight doesn't really make sense as is commonly associated with balance. Strength does make sense: a player can have a lot of strength but still no balance or a lot of strength and a lot of balance. It doesn't matter.

Inputs and Target

I would use LongShots, Positioning, Dribbling, Volley as inputs and Finishing as target. These inputs and target are all highly correlated. The sets of these ability as can help determine the ability of scoring.

Heatmap

plt.figure(figsize=(50, 25))
sns.heatmap(df_corr, annot=True, annot_kws={'size':13})
<AxesSubplot:>

png

Visualizations

SprintSpeed and Acceleration

These two columns present a strong linear relationship as SprintSpeed and Acceleration usually are correlated.

plt.scatter(x=df.SprintSpeed, y=df.Acceleration)
plt.xlabel('SprintSpeed')
plt.ylabel('Acceleration')
plt.title('SprintSpeed vs Acceleration')
plt.show()

png

Volleys and LongShots

These two columns present a strong linear relationship as the ability of executing longshots and volleys is correlated.

plt.scatter(x=df.Volleys, y=df.LongShots)
plt.xlabel('Volleys')
plt.ylabel('Longshots')
plt.title('Volleys vs LongShots')
plt.show()

png