Visualization Module

Result distribution plot

pyTSPA.visualization.plot_result_distribution(df: DataFrame)[source]

Visualizes overall result distribution: home wins, draws, away wins.

Args: df (pd.DataFrame): dataframe containing match data with ‘FTR’ column

Returns: None

Team results plot

pyTSPA.visualization.plot_team_results(df: DataFrame, team_name: str)[source]

Plots wins, draws, and losses for a single team.

Args: df (pd.DataFrame): dataframe containing match data with ‘HomeTeam’, ‘AwayTeam’, ‘FTR’ columns

team_name (str): name of the team to visualize results for

Returns: None

League points table

pyTSPA.visualization.plot_league_points_table(df: DataFrame)[source]

Plots total points for all teams as a horizontal bar chart.

Args: df (pd.DataFrame): dataframe generated by each_team_performance()

Returns: None

Goal difference distribution

pyTSPA.visualization.plot_goal_difference_distribution(df: DataFrame)[source]

Visualizes goal difference distribution for all teams.

Args: df (pd.DataFrame): dataframe generated by each_team_performance()

Returns: None

Win percentage comparison

pyTSPA.visualization.plot_win_percentage_comparison(df: DataFrame)[source]

Compares win percentage for all teams as a bar chart.

Args: df (pd.DataFrame): dataframe generated by each_win_percentage()

Returns: None

Pythagorean expectation plot

pyTSPA.visualization.plot_pythagorean_expectation(df: DataFrame)[source]

Visualizes pythagorean expectation alongside actual points for each team.

Args: df (pd.DataFrame): dataframe generated by each_team_performance() with pythagorean expectation values included

Returns: None