import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("C:/Users/autob/Downloads/epl data/players/player_premier_league_stats.csv")
x = df['Prog_Pas_Rec']
y = df['Asst90']
goals = df['Goals']
goals90 = df['Goals90']
colors = goals
sizes = goals90 * 50
plt.figure(figsize=(12, 8))
plt.scatter(x, y, s=sizes, c=colors, cmap='viridis', alpha=1, edgecolors='w')
plt.colorbar(label='Goals')
plt.xlabel('Progressive Passes Received')
plt.ylabel('Assists per 90')
plt.title('Scatter Plot of Progressive Passes Received vs Assists per 90 (Color by Goals, Size by Goals90)')
top_goals = df.sort_values(by='Goals', ascending=False).head(10)
top_goal_pen = df.sort_values(by='Goal-Pen', ascending=False).head(10)
top_players = pd.concat([top_goals, top_goal_pen]).drop_duplicates()
top_players = top_players.sort_values(by='Goals', ascending=False)
plt.tight_layout()
plt.show()
The scatter plot visualizes the relationship between progressive passes received and assists per 90 among Premier League players, with each player represented as a point.This positive trend shows that players who receive more progressive passes tend to provide more assists. The color of the points shows the total number of goals scored by each player. This then shows that goal scorers are spread across different levels of passing and assisting involvement. Additionally, the size of the points reflects the rate of goals scored per 90 minutes, highlighting players’ efficiency in converting chances. Clusters of players with moderate to high progressive passes and assists suggest key playmaking roles, while outliers demonstrate players’ abilities to create opportunities with fewer passes. This visualization aids coaches and analysts in identifying effective playmakers, goal creators, and efficient goal scorers, offering insights for team strategy and player selection in the Premier League.
players = top_players['Player']
goals = top_players['Goals']
goal_pen = top_players['Goal-Pen']
plt.figure(figsize=(12, 8))
bar_width = 0.35
index = range(len(players))
plt.bar(index, goals, width=bar_width, label='Goals', color='blue')
plt.bar([i + bar_width for i in index], goal_pen, width=bar_width, label='Goal-Pen', color='orange')
plt.xlabel('Player')
plt.ylabel('Count')
plt.xticks([i + bar_width/2 for i in index], players, rotation=45, ha='right')
plt.title('Top 10 Players by Goals and how many Penalties they scored')
plt.legend()
plt.tight_layout()
plt.show()
This barchart shwos that amount of goals the top 10 goals scorers have vs and the amount of penalty goals they’ve scored. From this chart you can see how mnay goals have been scored from open play. Open play goals can indicate more how goodf a striker really is. This is the case because most teams have designated penalty takers so some players stats can be a but inflated.