Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -380,6 +380,8 @@ with tab3:
|
|
| 380 |
display_baselines['cpt_lock'] = np.where(display_baselines['Player'].isin(lock_var1), 1, 0)
|
| 381 |
display_baselines['lock'] = np.where(display_baselines['Player'].isin(lock_var2), 1, 0)
|
| 382 |
|
|
|
|
|
|
|
| 383 |
|
| 384 |
index_check = pd.DataFrame()
|
| 385 |
flex_proj = pd.DataFrame()
|
|
@@ -433,6 +435,8 @@ with tab3:
|
|
| 433 |
combo_file = pd.concat([cpt_proj, flex_proj], ignore_index=True)
|
| 434 |
|
| 435 |
with col2:
|
|
|
|
|
|
|
| 436 |
optimize_container = st.empty()
|
| 437 |
download_container = st.empty()
|
| 438 |
freq_container = st.empty()
|
|
@@ -443,6 +447,8 @@ with tab3:
|
|
| 443 |
max_own = 1000
|
| 444 |
total_proj = 0
|
| 445 |
total_own = 0
|
|
|
|
|
|
|
| 446 |
optimize_container = st.empty()
|
| 447 |
download_container = st.empty()
|
| 448 |
freq_container = st.empty()
|
|
@@ -692,11 +698,26 @@ with tab3:
|
|
| 692 |
st.session_state.FD_final_outcomes_export = final_outcomes_export.copy()
|
| 693 |
|
| 694 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
| 695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 696 |
with optimize_container:
|
| 697 |
optimize_container = st.empty()
|
| 698 |
if 'final_outcomes' in st.session_state:
|
| 699 |
st.dataframe(st.session_state.final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
|
| 700 |
with download_container:
|
| 701 |
download_container = st.empty()
|
| 702 |
if site_var1 == 'Draftkings':
|
|
@@ -715,6 +736,7 @@ with tab3:
|
|
| 715 |
file_name='FD_NFL_optimals_export.csv',
|
| 716 |
mime='text/csv',
|
| 717 |
)
|
|
|
|
| 718 |
with freq_container:
|
| 719 |
freq_container = st.empty()
|
| 720 |
if 'player_freq' in st.session_state:
|
|
|
|
| 380 |
display_baselines['cpt_lock'] = np.where(display_baselines['Player'].isin(lock_var1), 1, 0)
|
| 381 |
display_baselines['lock'] = np.where(display_baselines['Player'].isin(lock_var2), 1, 0)
|
| 382 |
|
| 383 |
+
st.session_state.display_baselines = display_baselines.copy()
|
| 384 |
+
st.session_state.export_baselines = export_baselines.copy()
|
| 385 |
|
| 386 |
index_check = pd.DataFrame()
|
| 387 |
flex_proj = pd.DataFrame()
|
|
|
|
| 435 |
combo_file = pd.concat([cpt_proj, flex_proj], ignore_index=True)
|
| 436 |
|
| 437 |
with col2:
|
| 438 |
+
display_container = st.epmty()
|
| 439 |
+
display_dl_container = st.empty()
|
| 440 |
optimize_container = st.empty()
|
| 441 |
download_container = st.empty()
|
| 442 |
freq_container = st.empty()
|
|
|
|
| 447 |
max_own = 1000
|
| 448 |
total_proj = 0
|
| 449 |
total_own = 0
|
| 450 |
+
display_container = st.epmty()
|
| 451 |
+
display_dl_container = st.empty()
|
| 452 |
optimize_container = st.empty()
|
| 453 |
download_container = st.empty()
|
| 454 |
freq_container = st.empty()
|
|
|
|
| 698 |
st.session_state.FD_final_outcomes_export = final_outcomes_export.copy()
|
| 699 |
|
| 700 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
| 701 |
+
with display_container:
|
| 702 |
+
display_container = st.empty()
|
| 703 |
+
if 'display_baselines' in st.session_state:
|
| 704 |
+
st.dataframe(st.session_state.display_baselines.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 705 |
+
|
| 706 |
+
with display_dl_container:
|
| 707 |
+
display_dl_container = st.empty()
|
| 708 |
+
if 'export_baselines' in st.session_state:
|
| 709 |
+
st.download_button(
|
| 710 |
+
label="Export Projections",
|
| 711 |
+
data=convert_df_to_csv(st.session_state.export_baselines),
|
| 712 |
+
file_name='showdown_proj_export.csv',
|
| 713 |
+
mime='text/csv',
|
| 714 |
+
)
|
| 715 |
+
|
| 716 |
with optimize_container:
|
| 717 |
optimize_container = st.empty()
|
| 718 |
if 'final_outcomes' in st.session_state:
|
| 719 |
st.dataframe(st.session_state.final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 720 |
+
|
| 721 |
with download_container:
|
| 722 |
download_container = st.empty()
|
| 723 |
if site_var1 == 'Draftkings':
|
|
|
|
| 736 |
file_name='FD_NFL_optimals_export.csv',
|
| 737 |
mime='text/csv',
|
| 738 |
)
|
| 739 |
+
|
| 740 |
with freq_container:
|
| 741 |
freq_container = st.empty()
|
| 742 |
if 'player_freq' in st.session_state:
|