The following Libraries are needed
pip install -U mplsoccer
pip install networkx[default]
and the following just in case above library doesn't work(but by now it's not necessary)
pip install statsbomb
- Import using
from FunctionsProject import get_data, getNodes_Edges
- Use get_data to get dataframes needed
df_match, df_tactic, team_details = get_data(match_id, competition_id, season_id)
- To get Nodes and Edges uses getNodes_Edges
edges_TEAM, nodes_TEAM = getNodes_Edges('team name', df_match, df_tactic)
The above is just a format, you can rename the variables to your liking, for a better understanding of what is being done.
- df_match: contains all events from the match
- df_tactic: is used to get data related to players of a team
- team_details: contains team_name and tactics_formation of teams in the match
- edges_TEAM: is a dataframe with a pairkey values which are the interaction between two players, and a count column which is how many times players interact, in other words its weight
- nodes_TEAM = is the data frame with information about players of a specific team, like a name, positon, jersey number, etc
- match_id, competition_id, season_id: are values needed to get all other things and can be found doing some exploratory data using FindMatches.ipynb file