English Premier league 2022-23 : Evaluating Attacking Indices
- Radhin krishna
- Jun 30, 2024
- 5 min read
Updated: Jul 3, 2024
Introduction
Traditional metrics like goals scored and assists, while valuable, don't always capture the full picture. Expected Goals (xG) and Expected Assists (xA) offer a more nuanced perspective by considering the quality of a player's chances created and shots taken. Additionally, analyzing ball progression and ball carriage sheds light on a player's ability to move the ball up the field and retain possession.
This project aims to analyze the attacking metrics of English Premier League (EPL) players for the 2022-23 season. By combining data scraping techniques with data visualization tools, this report seeks to provide a comprehensive understanding of player contributions beyond traditional metrics.
Data Acquisition and Methodology
Web scraping with Python was employed to gather data on attacking metrics from fbref.com. freb is open source data provider.
This data included player name,goals scored, xG, assists, xA, ball progression(PrP), and ball carriage(PrC) for EPL players.
Import and Define URL:
pandas library is imported for data manipulation.
A variable url_df stores the target URL on FBref for player statistics.
Scrape Data:
pd.read_html(url_df)[0] reads the HTML content from the URL and extracts the first table (assuming it contains the player data). This creates a pandas DataFrame named df.
Clean DataFrame:
The code cleans up the column names in df.
It iterates through each column and combines any names with multiple levels (denoted by "level_0") into a single name using .strip() to remove extra spaces.
It resets the DataFrame's index to remove unnecessary numbering.
Rename Columns:
It iterates through each column name again.
If the name contains "level_0" (indicating a multi-level name), it extracts the last word (assuming it's the actual stat name).
Otherwise, it keeps the original name.
Finally, it assigns the new, cleaned column names back to the DataFrame.
Fill Missing Values and Save:
.fillna(0) replaces any missing values (like empty cells) in the DataFrame with zeros.
The DataFrame is saved as a CSV file named "premier_league_stats.csv".
The code prints a confirmation message upon successful saving.
Data Visualization and Analysis
Tableau was used to create visual representations of the collected data.
The report utilizes dumbbell charts to compare goals scored with xG and assists with xA, highlighting the discrepancy between actual outcomes and the expected value based on chance quality.
Additionally, a stacked bar chart showcases ball progression and ball carriage, offering insights into a player's ability to advance the ball and maintain possession.
Here's a more comprehensive explanation on creating the charts in Tableau along with some additional tips for enhancing your data visualization:
Connect to Data:
In Tableau, navigate to the "Data" menu and select "Connect to Data."
Choose "CSV (Comma-separated values)" and browse to your saved file "premier_league_stats.csv".(scrapped data)
Click "Open" to establish the connection.
Create Dumbbell Charts:
Drag "Player" to the Marks pane (typically on the left). This places player names on the marks card, which determines what elements will be displayed in the visualization.
Drag "Goals" to the Rows shelf. Rows determine how data is displayed on the vertical axis (Y-axis). By placing "Goals" on rows, you create a vertical axis representing the number of goals scored.
Drag "xG" to the Columns shelf. Columns define how data is displayed on the horizontal axis (X-axis). Here, "xG" will be plotted along the X-axis.
Now Tableau creates a scatter plot by default. To create a dumbbell chart, change the mark type to "Dual Axis." Right-click the small pill next to "Marks" in the Marks pane and select "Dual Axis." This splits the view into two axes, one for goals and one for xG.
By default, only one axis might display data points. To ensure both goals and xG are visualized, right-click on the "Axes" card in the Marks pane and select "Show Marks." This will display data points for both goals and xG on their respective axes.
Customization and Best Practices for Dumbbell Charts:
Dual Axis Formatting: Since you now have two axes, you can format them independently. Right-click on each axis in the Marks pane and select "Format Axis" to customize labels, fonts, and scaling. Consider using different colors for goals and xG to improve visual distinction.
Chart Title and Labels: Add a title to your chart that clearly describes the comparison (e.g., "Goals vs. Expected Goals (xG) for Premier League Players"). Label the X-axis as "Player" and the Y-axes accordingly (one for "Goals" and another for "xG").
Filtering (Optional): You can filter your data to focus on specific positions or teams for a more in-depth analysis. Use the filter pane on the left side of the Tableau interface to explore different subsets of players.
Create Stacked Bar Chart:
Drag "Player" to the Marks pane again. As before, this places player names on the Marks card.
Drag "Ball Carrying" to the Columns shelf. This defines the categories on the X-axis, where each bar will represent a player.
Drag "Ball Progression" to the Rows shelf. Since rows represent the Y-axis, stacking "Ball Progression" on top of "Ball Carrying" will create a stacked bar chart where the total height of each bar represents the sum of ball carrying and progression for a player.
By default, Tableau might create a bar chart with separate bars for each metric. To stack them, change the mark type to "Stacked Bar." Right-click the small pill next to "Marks" and select "Stacked Bar." This will stack the bars on top of each other, allowing for comparison of ball carrying and progression within each player.
Customization and Best Practices for Stacked Bar Chart:
Color and Labeling: Assign colors to differentiate between ball carrying and progression. Consider using a color scheme that intuitively represents these metrics (e.g., blue for carrying, green for progression). Label the X-axis as "Player" and the Y-axis as "Total Meters." You can also add a legend to clarify the color coding.
Sorting and filter: sort the bars by total ball carrying and progression (combined) or by each metric individually. Use the sorting options on the Marks card to arrange the bars in a way that best suits your analysis. filter out the top 10 players
Dash board creation
Insert the 3 charts which are created of dark silver background, change dash board backgroung to black and use text boxes to communicate general inferences.
Conclusion
Manchester City's Treble Charge: Powered by Attacking Prowess
Manchester City's historic hat-trick of Premier League titles can be largely attributed to their dominant attacking force. While all teams strive for goals and glory, City's approach transcended just scoring - it was about creating high-quality chances and possessing the ruthlessness to convert them.
Goal Scoring:
Mohamed Salah and Ollie Watkins, while boasting decent goal tallies, didn't quite match their expected goals (xG). This suggests they missed some clear-cut opportunities, leaving goals on the table. In contrast, strikers like Erling Haaland, Harry Kane, Martin Ødegaard, and Gabriel Martinelli consistently exceeded their xG, demonstrating a clinical finishing ability that turned half-chances into goals.
De Bruyne: The Assist Machine
Kevin De Bruyne solidified his reputation as the league's assist king. His impressive xA (expected assists) of 13.7, coupled with his actual 16 assists, highlights his ability to create high-quality scoring opportunities. Erling Haland's addition also made his efforts fruitful.
Fernandes' Frustration:
Whole picture of Mufc is in Bruno fernandes stats.Bruno Fernandes' statistics paint a picture of a playmaker burdened by an underperforming attack. His league-leading xA of 16.8 stands in stark contrast to his actual 8 assists. This disparity suggests a lack of clinical finishing from his teammates, squandering the numerous chances he created. Similar stories can be told for players like Alexander-Arnold, where a surplus of expected assists highlights the need for a more clinical touch upfront.
With proper training or addition of clinical strikers Lfc and Mufc has a chance to challenge the trophy next season.
Ball Progression
while Ben White,Bruno fernandes,Ødegaard choose to progress the ball using their passing ability .pascal Gorb,Rodri, keirren trippier choose carriedd it forward making them press resistant .



Comments