Data Visualization for Football Scouts: Searching the Best Players with PyGWalker
In the world of football, data has never been more crucial. Advanced statistics are now at the fingertips of scouts, analysts, and coaches, allowing them to identify the best players across various metrics. The intersection of football and data analysis brings the beautiful game into a new light, revealing hidden insights through data visualization.
Today, let’s explore the 2022–2023 Football Player Stats dataset from Kaggle with PyGWalker, and try to find out the hidden gems with the potential to be the next football star.
Explore the Football Data Jungle with PyGWalker
PyGWalker, in its essence, is like a good assistant referee — dependable, always there when you need it, and can make tough calls clearer.
This Open Source Python Library natively integrates with your Jupyter Notebook, converting pandas dataframes into an interactive user interface similar to Tableau, where you can create visualizations by dragging and dropping variables.
To install and set up PyGWalker, run these commands in your terminal:
pip install pygwalker
Import PyGWalker and pandas into your Jupyter Notebook, and you’re all set to decipher the complicated football data:
import pandas as pd
import pygwalker as pyg
df = pd.read_csv('./football_data.csv')
gwalker = pyg.walk(df)
You can run the demo code in Kaggle Notebook here.
With the tools ready, now let’s begin our journey:
Scouting the Net-Busters: Who’s the Next Robert Lewandowski?
Imagine being a scout for Chelsea, desperately seeking a prolific goal-scorer and avoiding another disastrous, goalless season. You’re on a mission, where shall you filter out the right man for Mr. Boehly?
Here’s the visualized data for the most efficient scorers in European major Leagues for the 2022–2023 season:
In this graph, we take:
- Goals per Shot (G/Sh) on X-axis, and Goals per Shot on Target (G/SoT) on Y-axis, indicating their efficiency to score.
- The size of the circle shows the total goal.
- The darker the circle is, the more time the player has played.
This scatterplot is your compass, directing you toward those deadly forwards who can emulate Lewandowski’s incredible goal-scoring spree. Let’s find out some top candidates:
Yes, here he is. The Golden Boot Winner of the Premier League this season, Erling Haaland, the big, dark spot on the top of the graph. He deserves all the praise he gets.
Both Christopher Nkunku and Victor Osimhen had a fantastic season in Bundesliga and Serie A. They are not yet on the level of Haaland but hey, they can improve.
Breel Embolo: The 26 years old Swiss forward has been improving consistently, and recently had a good season in Monaco. Is he going to move to a big club?
Find Out the Goldern Boy Midfielder
Every great team needs a midfield orchestrator, a player capable of delivering those key passes that split defenses. Let’s find out who is our guy!
We are visualizing these metrics as x-axis and y-axis to identify how creative a midfielder is:
- Progressive Passes (PasProg): Completed passes that move the ball toward the opponent’s goal at least 10 yards from its furthest point in the last six passes, or any completed pass into the penalty area.
- Final Third Passes (Pas3rd): Completed passes that enter the 1/3 of the pitch closest to the goal.
The Size of the circle indicates the Passes that a midfield completed(PasCmp). The larger it is, the more passes a midfielder attempts.
The color of the circle indicates the number of passes that is converted to a shot attempt(PasShotAtt). The darker the dot, the more “deadly” the midfielder is.
This chart is your looking glass, revealing those unsung heroes who hold the strings in midfield, just like Iniesta did at his peak. Let’s take a look at some top performers:
Yes, aged like an old wine. Toni Kross doesn’t try that much, but hey, whenever he does, it’s deadly.
Dani Ceballos did not match the expectation at Real Madrid, but actually, he isn’t that bad. Whoever gonna pick him up will turn out to be a steal.
Who is the Magic Man?
Now let’s talk about the dream of every football manager: find out who is the next Lionel Messi, the ones capable of turning defenders into mere training cones.
We’re tracking these variables to discover football’s next sensation:
- Take On Attempts (ToAtt): Number of attempts to take on defenders while dribbling.
- Successful Take Ons (ToSuc): Number of defenders taken on successfully, by dribbling past them.
- Shot Creating Actions from Dribbling (ScaDrib): Successful dribbles that lead to a shot attempt.
- Shot Creating Actions from Fouls Drawn (ScaFld): Fouls drawn that lead to a shot attempt
Let’s visualize the data with PyGWalker and craft a chart:
Let’s get started:
Lionel Messi is here. Well, he mainly played a supportive role at Paris Saint-German this season, not surprising but still impressive.
Rayan Cherki: The rising star of French football, potentially the next Eden Hazard, is quickly bypassing Messi on the Chart.
Allan Saint-Maximin’s sensational run at Newcastle this season was disturbed by the injury. We have high hopes for him in the future.
Datro Fofana wasn’t that bad for a horrible season. But can Chelsea wait for a young player to grow? That’s a big question.
Find Out the Best Defender in Europe Now
You are a manager struggling to find the next Van Dijk who can command the backline. Now let’s run the data through PyGWalker and figure something out with these metrics:
- Aerials Won (AerWon)
- Tackles Won (TklWon)
- Clearances (Clr)
- Interceptions (Int)
Trevoh Chalobah is another Chelsea young talent who was dragged down by the messy season. Can he bounce back?
Who Has the Worst Discipline?
Now things start to get ugly. Let’s identify the players with the worst discipline. We will take these metrics into account:
- Fouls Committed (Fls)
- Minutes Played (Min)
- Yellow Cards (CrdY)
- Errors Leading to Shots (Err)
Currently playing at LOSC, Carlos Baleba is a promising defender that has a bright future. But maybe he should take more time building defending skill sets?
Epilogue
In this article, we’ve embarked on a journey across the 2022–2023 European Leagues Player Stats, discovering hidden gems and understanding the stories behind the numbers with the help of PyGWalker.
As we continue to explore this frontier, we’re revolutionizing how we perceive the beautiful game. The future of football scouting is here. Let’s embrace it together.
And, don’t forget to check out PyGWalker on GitHub. Spread the word about PyGWalker, and give us a star!