Update app.py
Browse files
app.py
CHANGED
@@ -687,7 +687,7 @@ with tab3:
|
|
687 |
final_outcomes_export['Own'] = final_outcomes['Own']
|
688 |
final_outcomes_export['Proj'] = final_outcomes['Proj']
|
689 |
|
690 |
-
st.session_state.
|
691 |
|
692 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
693 |
|
@@ -697,13 +697,22 @@ with tab3:
|
|
697 |
st.dataframe(st.session_state.final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
698 |
with download_container:
|
699 |
download_container = st.empty()
|
700 |
-
if '
|
701 |
-
st.
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
with freq_container:
|
708 |
freq_container = st.empty()
|
709 |
if 'player_freq' in st.session_state:
|
|
|
687 |
final_outcomes_export['Own'] = final_outcomes['Own']
|
688 |
final_outcomes_export['Proj'] = final_outcomes['Proj']
|
689 |
|
690 |
+
st.session_state.FD_final_outcomes_export = final_outcomes_export.copy()
|
691 |
|
692 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
693 |
|
|
|
697 |
st.dataframe(st.session_state.final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
698 |
with download_container:
|
699 |
download_container = st.empty()
|
700 |
+
if site_var1 == 'Draftkings':
|
701 |
+
if 'final_outcomes_export' in st.session_state:
|
702 |
+
st.download_button(
|
703 |
+
label="Export Optimals",
|
704 |
+
data=convert_df_to_csv(st.session_state.final_outcomes_export),
|
705 |
+
file_name='NFL_optimals_export.csv',
|
706 |
+
mime='text/csv',
|
707 |
+
)
|
708 |
+
elif site_var1 == 'Fanduel':
|
709 |
+
if 'FD_final_outcomes_export' in st.session_state:
|
710 |
+
st.download_button(
|
711 |
+
label="Export Optimals",
|
712 |
+
data=convert_df_to_csv(st.session_state.FD_final_outcomes_export),
|
713 |
+
file_name='FD_NFL_optimals_export.csv',
|
714 |
+
mime='text/csv',
|
715 |
+
)
|
716 |
with freq_container:
|
717 |
freq_container = st.empty()
|
718 |
if 'player_freq' in st.session_state:
|