Multichem commited on
Commit
2426e3e
·
verified ·
1 Parent(s): 8ae0ee8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -1
app.py CHANGED
@@ -512,7 +512,47 @@ with tab1:
512
  file_name='MLB_consim_export.csv',
513
  mime='text/csv',
514
  )
515
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  with st.container():
517
  tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8, tab9 = st.tabs(['Overall Exposures', 'QB Exposures', 'RB-WR-TE Exposures', 'RB Exposures', 'WR Exposures', 'TE Exposures', 'FLEX Exposures', 'DST Exposures', 'Team Exposures'])
518
  with tab1:
 
512
  file_name='MLB_consim_export.csv',
513
  mime='text/csv',
514
  )
515
+ with st.container():
516
+ if 'Sim_Winner_Display' in st.session_state:
517
+ # Create a new dataframe with summary statistics
518
+ summary_df = pd.DataFrame({
519
+ 'Metric': ['Min', 'Average', 'Max'],
520
+ 'Salary': [
521
+ st.session_state.Sim_Winner_Display['Salary'].min(),
522
+ st.session_state.Sim_Winner_Display['Salary'].mean(),
523
+ st.session_state.Sim_Winner_Display['Salary'].max()
524
+ ],
525
+ 'Proj': [
526
+ st.session_state.Sim_Winner_Display['Proj'].min(),
527
+ st.session_state.Sim_Winner_Display['Proj'].mean(),
528
+ st.session_state.Sim_Winner_Display['Proj'].max()
529
+ ],
530
+ 'Own': [
531
+ st.session_state.Sim_Winner_Display['Own'].min(),
532
+ st.session_state.Sim_Winner_Display['Own'].mean(),
533
+ st.session_state.Sim_Winner_Display['Own'].max()
534
+ ],
535
+ 'Fantasy': [
536
+ st.session_state.Sim_Winner_Display['Fantasy'].min(),
537
+ st.session_state.Sim_Winner_Display['Fantasy'].mean(),
538
+ st.session_state.Sim_Winner_Display['Fantasy'].max()
539
+ ],
540
+ 'GPP_Proj': [
541
+ st.session_state.Sim_Winner_Display['GPP_Proj'].min(),
542
+ st.session_state.Sim_Winner_Display['GPP_Proj'].mean(),
543
+ st.session_state.Sim_Winner_Display['GPP_Proj'].max()
544
+ ]
545
+ })
546
+
547
+ # Display the summary dataframe
548
+ st.subheader("Summary Statistics")
549
+ st.dataframe(summary_df.style.format({
550
+ 'Salary': '{:.2f}',
551
+ 'Proj': '{:.2f}',
552
+ 'Own': '{:.2%}',
553
+ 'Fantasy': '{:.2f}',
554
+ 'GPP_Proj': '{:.2f}'
555
+ }).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own', 'Fantasy', 'GPP_Proj']), use_container_width=True)
556
  with st.container():
557
  tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8, tab9 = st.tabs(['Overall Exposures', 'QB Exposures', 'RB-WR-TE Exposures', 'RB Exposures', 'WR Exposures', 'TE Exposures', 'FLEX Exposures', 'DST Exposures', 'Team Exposures'])
558
  with tab1: