Get information from football games for different competitions and leverage data visualization to statistically analyze and visualize the performance of football teams and players. The scripts are written and intended to use with Python 3.
git clone https://github.com/andrebrener/football_data.git
Go in the directory of the repo and run:
pip install -r requirements.txt
- Insert Constants in constants.py.
- Select start & end dates.
- Select competition from the competition dictionary.
- Run game_data.py.
- A directory named
game_data
will be created in the repo with a csv file namedgames_data_{start_date}_{end_date}.csv
. - This csv will contain the data for the games of the selected competition and dates including:
- Date of the game.
- Home & away teams.
- Result of the game.
- Total shots and shots on goal.
- Percentage ball possessions.
- Fouls and yellow & red cards.
- Team who made the first goal.
- Team that was 2-0 in any moment of the game. This value is null if no team complies with this condition.
- Number of penalties per team.
This graph shows the average location of the players and the pass distribution of the team during the game. To be able to run passes_map.py, the csv must be in the format as this one.
This graph compares teams/players in many aspects of the game at the same time. To be able to run radars_graph.py, the csv must be in the format as this one.
This graph shows if the player was over or underperforming compared to what he was expected to. To be able to run over_under_perform.py, the csv must be in the format as this one.
The season_analysis.py script is used to compare teams and team_players_comparison.py compares the players. After running the scripts, you will get a series un graphs with their comparison in different aspects of the game. The options for these graphs are:
- Change titles and subtitles of graphs.
- Define a team/player that you want to be remarked from the rest.
- The maximum number of teams/players in the graph.
- Insert Constants in constants.py.
- Select start & end dates.
- Select competition from the competition dictionary.
- Run player_in_goals.py.
- A directory named
player_in_goals
will be created in the repo with a csv file namedgames_data_{start_date}_{end_date}.csv
. - This csv will contain the data for the players of the selected competition and dates including:
- Name and team of the player. More than one player with exactly the same name in the same team will make that data invalid.
- Minutes on and off the pitch.
- Total team goals for and against.
- Team goals for and against with the player in the pitch.