[3]:
import soccerdata as sd
SoFIFA#
[4]:
sofifa = sd.SoFIFA(leagues="ENG-Premier League", seasons=2021)
print(sofifa.__doc__)
/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/soccerdata/soccerdata/_common.py:466: UserWarning: Season id "2021" is ambiguous: interpreting as "20-21"
warnings.warn(msg)
Provides pd.DataFrames from data at http://sofifa.com.
Data will be downloaded as necessary and cached locally in
``~/soccerdata/data/SoFIFA``.
Parameters
----------
leagues : string or iterable, optional
IDs of leagues to include.
seasons : string, int or list, optional
Seasons to include. Supports multiple formats.
Examples: '16-17'; 2016; '2016-17'; [14, 15, 16]
proxy : 'tor' or or dict or list(dict) or callable, optional
Use a proxy to hide your IP address. Valid options are:
- "tor": Uses the Tor network. Tor should be running in
the background on port 9050.
- dict: A dictionary with the proxy to use. The dict should be
a mapping of supported protocols to proxy addresses. For example::
{
'http': 'http://10.10.1.10:3128',
'https': 'http://10.10.1.10:1080',
}
- list(dict): A list of proxies to choose from. A different proxy will
be selected from this list after failed requests, allowing rotating
proxies.
- callable: A function that returns a valid proxy. This function will
be called after failed requests, allowing rotating proxies.
no_cache : bool
If True, will not use cached data.
no_store : bool
If True, will not store downloaded data.
data_dir : Path
Path to directory where data will be cached.
EA Sports FIFA player ratings#
[5]:
ratings = sofifa.read_ratings()
ratings.head()
[5]:
overall_rating | potential | crossing | finishing | heading_accuracy | short_passing | volleys | dribbling | curve | fk_accuracy | long_passing | ball_control | acceleration | sprint_speed | agility | reactions | balance | shot_power | jumping | stamina | strength | long_shots | aggression | interceptions | positioning | vision | penalties | composure | marking | standing_tackle | sliding_tackle | gk_diving | gk_handling | gk_kicking | gk_positioning | gk_reflexes | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
league | season | player | ||||||||||||||||||||||||||||||||||||
ENG-Premier League | 2021 | Aaron Cresswell | Best Overall Rating | None | 83 | 54 | 68 | 77 | 48 | 76 | 80 | 76 | 69 | 77 | 72 | 67 | 73 | 78 | 81 | 71 | 86 | 75 | 61 | 66 | 73 | 77 | 60 | 68 | 59 | 73 | None | 78 | 79 | 14 | 7 | 9 | 9 | 12 |
Aaron Lennon | Best Overall Rating | None | 74 | 58 | 26 | 72 | 68 | 79 | 66 | 53 | 64 | 72 | 80 | 77 | 81 | 73 | 93 | 64 | 60 | 68 | 53 | 57 | 55 | 50 | 72 | 72 | 62 | 73 | None | 50 | 43 | 14 | 7 | 7 | 16 | 11 | ||
Aaron Ramsdale | Best Overall Rating | None | 15 | 14 | 15 | 54 | 16 | 18 | 17 | 16 | 54 | 35 | 47 | 50 | 53 | 80 | 49 | 63 | 66 | 35 | 59 | 15 | 35 | 24 | 18 | 64 | 25 | 65 | None | 16 | 15 | 82 | 77 | 84 | 78 | 84 | ||
Abdoulaye Doucouré | Best Overall Rating | None | 69 | 75 | 69 | 81 | 68 | 79 | 44 | 42 | 77 | 81 | 67 | 76 | 65 | 79 | 68 | 84 | 73 | 90 | 82 | 77 | 78 | 81 | 77 | 75 | 54 | 77 | None | 80 | 76 | 15 | 12 | 12 | 15 | 14 | ||
Adam Webster | Best Overall Rating | None | 50 | 30 | 78 | 74 | 27 | 68 | 27 | 25 | 70 | 73 | 64 | 74 | 63 | 74 | 57 | 37 | 77 | 69 | 77 | 32 | 75 | 76 | 26 | 53 | 24 | 77 | None | 77 | 75 | 10 | 8 | 14 | 7 | 12 |