Multichem commited on
Commit
103c734
·
verified ·
1 Parent(s): ffe7479

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -19
app.py CHANGED
@@ -233,54 +233,44 @@ with col1:
233
  elif split_var1 == 'Full Slate Run':
234
  team_var1 = hitter_stats.Team.values.tolist()
235
 
236
- TA_table = True_AVG_Splits_load()
237
- HWS_table = HWSr_Splits_load()
238
- SP_slate_table = SP_Slate_Stats_load()
239
- RHH_table = RHH_load()
240
- LHH_table = LHH_load()
241
- Full_stats_table = Full_Stats_load()
242
- Full_RHH_table = Full_RHH_load()
243
- Full_LHH_table = Full_LHH_load()
244
- Bullpen_table = Bullpen_Data_load()
245
-
246
  with col2:
247
  if stat_type_var1 == 'Pitchers':
248
  if stat_var1 == 'True AVG Splits':
249
- pitcher_stats = TA_table
250
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
251
  pitcher_stats = pitcher_stats.set_index('Player')
252
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').format(precision=3), use_container_width = True)
253
  if stat_var1 == 'HWSr Splits':
254
- pitcher_stats = HWS_table
255
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
256
  pitcher_stats = pitcher_stats.set_index('Player')
257
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').format(precision=3), use_container_width = True)
258
  elif stat_var1 == 'Current Slate Stats':
259
- pitcher_stats = SP_slate_table
260
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
261
  pitcher_stats = pitcher_stats.set_index('Player')
262
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
263
  elif stat_var1 == 'Stats vs. RHH':
264
- pitcher_stats = RHH_table
265
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
266
  pitcher_stats = pitcher_stats.set_index('Names')
267
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r', subset=['Opp RHH', 'Salary', 'BB%', 'True AVG', 'xSLG', 'xBA', 'Hits', 'Homeruns', 'xHRs']).background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
268
  elif stat_var1 == 'Stats vs. LHH':
269
- pitcher_stats = LHH_table
270
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
271
  pitcher_stats = pitcher_stats.set_index('Names')
272
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r', subset=['Opp LHH', 'Salary', 'BB%', 'True AVG', 'xSLG', 'xBA', 'Hits', 'Homeruns', 'xHRs']).background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
273
  elif stat_var1 == 'Full League Stats':
274
- pitcher_stats = Full_stats_table
275
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
276
  elif stat_var1 == 'Full League Stats vs. RHH':
277
- pitcher_stats = Full_RHH_table
278
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
279
  elif stat_var1 == 'Full League Stats vs. LHH':
280
- pitcher_stats = Full_LHH_table
281
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
282
  elif stat_var1 == 'Bullpen Data':
283
- pitcher_stats = Bullpen_table
284
  pitcher_stats = pitcher_stats[pitcher_stats['Names'].isin(sp_var1)]
285
  pitcher_stats = pitcher_stats.set_index('Names')
286
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = BP_league_format), use_container_width = True)
 
233
  elif split_var1 == 'Full Slate Run':
234
  team_var1 = hitter_stats.Team.values.tolist()
235
 
 
 
 
 
 
 
 
 
 
 
236
  with col2:
237
  if stat_type_var1 == 'Pitchers':
238
  if stat_var1 == 'True AVG Splits':
239
+ pitcher_stats = True_AVG_Splits_load()
240
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
241
  pitcher_stats = pitcher_stats.set_index('Player')
242
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').format(precision=3), use_container_width = True)
243
  if stat_var1 == 'HWSr Splits':
244
+ pitcher_stats = HWSr_Splits_load()
245
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
246
  pitcher_stats = pitcher_stats.set_index('Player')
247
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').format(precision=3), use_container_width = True)
248
  elif stat_var1 == 'Current Slate Stats':
249
+ pitcher_stats = SP_Slate_Stats_load()
250
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
251
  pitcher_stats = pitcher_stats.set_index('Player')
252
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap = 'RdYlGn_r').background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
253
  elif stat_var1 == 'Stats vs. RHH':
254
+ pitcher_stats = RHH_load()
255
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
256
  pitcher_stats = pitcher_stats.set_index('Names')
257
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r', subset=['Opp RHH', 'Salary', 'BB%', 'True AVG', 'xSLG', 'xBA', 'Hits', 'Homeruns', 'xHRs']).background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
258
  elif stat_var1 == 'Stats vs. LHH':
259
+ pitcher_stats = LHH_load()
260
  pitcher_stats = pitcher_stats[pitcher_stats['Team'].isin(sp_var1)]
261
  pitcher_stats = pitcher_stats.set_index('Names')
262
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r', subset=['Opp LHH', 'Salary', 'BB%', 'True AVG', 'xSLG', 'xBA', 'Hits', 'Homeruns', 'xHRs']).background_gradient(cmap='RdYlGn', subset='K%').format(SP_format, precision=2), use_container_width = True)
263
  elif stat_var1 == 'Full League Stats':
264
+ pitcher_stats = Full_Stats_load()
265
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
266
  elif stat_var1 == 'Full League Stats vs. RHH':
267
+ pitcher_stats = Full_RHH_load()
268
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
269
  elif stat_var1 == 'Full League Stats vs. LHH':
270
+ pitcher_stats = Full_LHH_load()
271
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = SP_league_format), use_container_width = True)
272
  elif stat_var1 == 'Bullpen Data':
273
+ pitcher_stats = Bullpen_Data_load()
274
  pitcher_stats = pitcher_stats[pitcher_stats['Names'].isin(sp_var1)]
275
  pitcher_stats = pitcher_stats.set_index('Names')
276
  st.dataframe(pitcher_stats.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn_r').background_gradient(cmap='RdYlGn', subset=['Strikeoutper', 'Strikeouts', 'PA']).format(precision=0).format(precision=3, subset = BP_league_format), use_container_width = True)