Ajay Prakash Nair
Ajay Prakash Nair's Blog

Ajay Prakash Nair's Blog

Messi vs Ronaldo (An analytical Debate)

Messi vs Ronaldo (An analytical Debate)

Ajay Prakash Nair's photo
Ajay Prakash Nair
·Oct 3, 2021·

3 min read

Subscribe to my newsletter and never miss my upcoming articles

Note : This analysis is done on the stats available in Understat website from 2014-2020 and only the club stats were taken into consideration.

In this project I have tried to compare the different stats of two different soccer players to compare their performance and know who comes out on top.

Concepts needed: Numpy, Pandas, Visualization, Web Scraping, Data Cleaning, EDA

Libraries Used: json, pandas, BeautifulSoup, urlopen, MinMaxScaler, Seaborn, Matplotlib, Plotly

Steps:

  • Getting the required data from Undestat website
  • Data Cleaning and Exploration for different aspects of the players
  • Comparative analysis
  • Shots analysis
  • Final Comparison

First I scraped the players’ season wise data from the understat website. Then, I combined both the player’s data into a single dataframe. Then, I cleaned the data and removed null and error values. I also perform Exploratory data analysis to summarize their main characteristics. The visual EDA helped in drawing meaningful patterns and insights. The visual EDA for the Consolidated Data for all seasons per player is given below.

newplot.png

Here,

xG → Expected Goals

npg → Non Penalty Goals

xGChain --> Calculating xG for possessions that lead to a shot where the player was involved at least once in that possession, INCLUDING the final pass or the shot.

xGBuildup --> Calculating xG for possessions that lead to a shot where the player was involved at least once in that possession, EXCLUDING the final pass or the shot.

Then, I performed EDA on Season-wise Stats (Consolidated data per season per player).

newplot(1).png

Then, performed EDA on different factors like Shots and Assisting Player Comparison. The results are shown below.

newplot(2).png

newplot(3).png

newplot(4).png

It was interesting to note that both players have had a fruitful relationship with their respective left-backs.

Then, performed a comparison between Shots vs Goals and plotted it using a Scatter Plot.

newplot(5).png

It was clearly observed that Lionel Messi had a better Goals to Shot ratio than Cristiano Ronaldo.

Then, a comparison between Total Goals vs Non-penalty Goals was done. It was also plotted using the scatter plot.

newplot(6).png

From the graph, it was concluded that both Lionel Messi and Cristiano Ronaldo have almost the same ratio when comparing in 2014. But, Messi had more Non-Penalty Goals than Ronaldo in 2016,2017 and 2018.

Then, a comparison between Total Goals scored and Total Expected Goals was done for both the players.

newplot(7).png

It was observed that both the players have kept their expectations and in some seasons have even scored more goals than that was expected.

Then, a comparison between Total goals and Total Assists per Season was done.

newplot(8).png

And It was clear from the graph that Messi has a better Goals to Assist ratio which shows Messi is a better playmaker than Ronaldo.

A comparison between xGChain and xGBuildup was also done.

newplot(9).png

Then, I plotted a shot map for both the players. Below is the shot map for Cristiano Ronaldo.

cr.png

Below is the shot map for Lionel Messi.

ms.png

The pitch heat map for both the players was also plotted. The following is the heat map for Cristiano Ronaldo.

crr.png

The following is the heat map for Lionel Messi.

lm.png

The final comparison was made using the Radar Plot.

newplot(10).png

From the Radar Plot it is clear that Ronaldo has more shots than Messi and Messi has more key passes and xGChain than Ronaldo.

So, Go through the analysis and make up your mind.

Link to the Github Repository

 
Share this