Sathwikchowdary commited on
Commit
e8a947e
·
verified ·
1 Parent(s): 5b925e2

Update pages/1player_information.py

Browse files
Files changed (1) hide show
  1. pages/1player_information.py +10 -1
pages/1player_information.py CHANGED
@@ -21,7 +21,7 @@ if player_input:
21
  if selected_player in df["Player"].values:
22
  player_data = df[df["Player"] == selected_player].iloc[0]
23
 
24
- # Pie Chart - Matches Played Across Formats
25
  matches = [
26
  player_data["Matches_Test"],
27
  player_data["Matches_ODI"],
@@ -49,6 +49,14 @@ if player_input:
49
  ax.set_title(f"Runs Scored by {selected_player}", fontsize=14)
50
  st.pyplot(fig)
51
 
 
 
 
 
 
 
 
 
52
  # Line Chart - Batting Average Over Formats
53
  batting_average = [
54
  player_data["batting_Runs_Test"] / max(1, player_data["batting_Innings_Test"]),
@@ -70,5 +78,6 @@ if player_input:
70
  ax.set_title("Distribution of Runs Scored in ODIs (All Players)", fontsize=14)
71
  st.pyplot(fig)
72
 
 
73
  else:
74
  st.error("🚨 Player not found! Please enter a valid player name.")
 
21
  if selected_player in df["Player"].values:
22
  player_data = df[df["Player"] == selected_player].iloc[0]
23
 
24
+ # Pie Chart - Matches Played Across Formats
25
  matches = [
26
  player_data["Matches_Test"],
27
  player_data["Matches_ODI"],
 
49
  ax.set_title(f"Runs Scored by {selected_player}", fontsize=14)
50
  st.pyplot(fig)
51
 
52
+ # Scatter Plot - Matches vs Runs (ODIs)
53
+ fig, ax = plt.subplots()
54
+ sns.scatterplot(x=df["Matches_ODI"], y=df["batting_Runs_ODI"], ax=ax, color="#4682B4", edgecolor='black')
55
+ ax.set_xlabel("Matches Played", fontsize=12)
56
+ ax.set_ylabel("Runs Scored", fontsize=12)
57
+ ax.set_title("Matches vs Runs in ODIs (All Players)", fontsize=14)
58
+ st.pyplot(fig)
59
+
60
  # Line Chart - Batting Average Over Formats
61
  batting_average = [
62
  player_data["batting_Runs_Test"] / max(1, player_data["batting_Innings_Test"]),
 
78
  ax.set_title("Distribution of Runs Scored in ODIs (All Players)", fontsize=14)
79
  st.pyplot(fig)
80
 
81
+
82
  else:
83
  st.error("🚨 Player not found! Please enter a valid player name.")