Sathwikchowdary commited on
Commit
aa3320b
·
verified ·
1 Parent(s): 7114d9a

Update pages/1player_information.py

Browse files
Files changed (1) hide show
  1. pages/1player_information.py +19 -50
pages/1player_information.py CHANGED
@@ -101,60 +101,29 @@ if selected_player:
101
  ax.set_title(f"Strike Rate & Batting Average of {selected_player}")
102
  ax.legend()
103
  st.pyplot(fig)
104
-
105
- if show_bowling:
106
- col1, col2 = st.columns(2)
107
-
108
- with col1:
109
- # Bar Chart - Wickets Taken
110
- wickets = [
111
- player_data.get("bowling_Test_Wickets", 0),
112
- player_data.get("bowling_ODI_Wickets", 0),
113
- player_data.get("bowling_T20_Wickets", 0),
114
- player_data.get("bowling_IPL_Wickets", 0)
115
- ]
116
- fig, ax = plt.subplots()
117
- ax.bar(labels, wickets, color=["gold", "green", "blue", "red"])
118
- ax.set_ylabel("Wickets")
119
- ax.set_title(f"Wickets Taken by {selected_player}")
120
- st.pyplot(fig)
121
 
122
- with col2:
123
- # Bar Chart - Bowling Average
124
- bowling_avg = [
125
- player_data.get("bowling_Test_Avg", 0),
126
- player_data.get("bowling_ODI_Avg", 0),
127
- player_data.get("bowling_T20_Avg", 0),
128
- player_data.get("bowling_IPL_Avg", 0)
129
- ]
130
- fig, ax = plt.subplots()
131
- ax.bar(labels, bowling_avg, color=["red", "blue", "green", "purple"])
132
- ax.set_ylabel("Bowling Average")
133
- ax.set_title(f"Bowling Average of {selected_player}")
134
- st.pyplot(fig)
135
-
136
- # Bar Chart - Balls Bowled
137
- balls_bowled = [
138
- player_data.get("bowling_Test_Balls", 0),
139
- player_data.get("bowling_ODI_Balls", 0),
140
- player_data.get("bowling_T20_Balls", 0),
141
- player_data.get("bowling_IPL_Balls", 0)
142
  ]
143
- fig, ax = plt.subplots()
144
- ax.bar(labels, balls_bowled, color=["orange", "cyan", "magenta", "yellow"])
145
- ax.set_ylabel("Balls Bowled")
146
- ax.set_title(f"Balls Bowled by {selected_player}")
147
  st.pyplot(fig)
148
-
149
  # Bar Chart - Maidens Bowled
150
- maidens = [
151
- player_data.get("bowling_Test_Maidens", 0),
152
- player_data.get("bowling_ODI_Maidens", 0),
153
- player_data.get("bowling_T20_Maidens", 0),
154
- player_data.get("bowling_IPL_Maidens", 0)
155
  ]
156
- fig, ax = plt.subplots()
157
- ax.bar(labels, maidens, color=["blue", "green", "red", "purple"])
158
- ax.set_ylabel("Maidens")
159
  ax.set_title(f"Maidens Bowled by {selected_player}")
160
  st.pyplot(fig)
 
101
  ax.set_title(f"Strike Rate & Batting Average of {selected_player}")
102
  ax.legend()
103
  st.pyplot(fig)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
+ # Bar Chart - Balls Faced
106
+ batting_balls = [
107
+ player_data.get("batting_Balls_Test", 0),
108
+ player_data.get("batting_Balls_ODI", 0),
109
+ player_data.get("batting_Balls_T20", 0),
110
+ player_data.get("batting_Balls_IPL", 0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  ]
112
+ fig, ax = plt.subplots(figsize=(5,3))
113
+ ax.bar(labels, batting_balls, color=["red", "green", "blue", "purple"])
114
+ ax.set_ylabel("Balls Faced")
115
+ ax.set_title(f"Balls Faced by {selected_player}")
116
  st.pyplot(fig)
117
+
118
  # Bar Chart - Maidens Bowled
119
+ maidens_bowled = [
120
+ player_data.get("bowling_Maidens_Test", 0),
121
+ player_data.get("bowling_Maidens_ODI", 0),
122
+ player_data.get("bowling_Maidens_T20", 0),
123
+ player_data.get("bowling_Maidens_IPL", 0)
124
  ]
125
+ fig, ax = plt.subplots(figsize=(5,3))
126
+ ax.bar(labels, maidens_bowled, color=["cyan", "magenta", "yellow", "black"])
127
+ ax.set_ylabel("Maidens Bowled")
128
  ax.set_title(f"Maidens Bowled by {selected_player}")
129
  st.pyplot(fig)