Update app.py
Browse files
app.py
CHANGED
@@ -293,6 +293,9 @@ with tab3:
|
|
293 |
dk_roo_raw_2 = load_dk_player_projections_2()
|
294 |
fd_roo_raw = load_fd_player_projections()
|
295 |
fd_roo_raw_2 = load_fd_player_projections_2()
|
|
|
|
|
|
|
296 |
slate_var1 = st.radio("Which data are you loading?", ('Paydirt (Main)', 'Paydirt (Secondary)', 'User'), key='slate_var1')
|
297 |
site_var1 = st.selectbox("What site is the showdown on?", ('Draftkings', 'Fanduel'), key='site_var1')
|
298 |
if site_var1 == 'Draftkings':
|
@@ -329,21 +332,7 @@ with tab3:
|
|
329 |
min_sal1 = st.number_input('Min Salary', min_value = 45000, max_value = 59900, value = 59000, step = 100, key='min_sal1')
|
330 |
max_sal1 = st.number_input('Max Salary', min_value = 45000, max_value = 60000, value = 60000, step = 100, key='max_sal1')
|
331 |
with col2:
|
332 |
-
|
333 |
-
with st.container():
|
334 |
-
if 'portfolio' in st.session_state:
|
335 |
-
st.dataframe(st.session_state.portfolio.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
336 |
-
if 'final_outcomes_export' in st.session_state:
|
337 |
-
st.download_button(
|
338 |
-
label="Export Tables",
|
339 |
-
data=convert_df_to_csv(st.session_state.final_outcomes_export),
|
340 |
-
file_name='MLB_optimals_export.csv',
|
341 |
-
mime='text/csv',
|
342 |
-
)
|
343 |
-
|
344 |
-
with st.container():
|
345 |
-
if 'player_freq' in st.session_state:
|
346 |
-
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(expose_format, precision=2), use_container_width = True)
|
347 |
if contest_var1 == 'Small Field GPP':
|
348 |
if site_var1 == 'Draftkings':
|
349 |
ownframe = raw_baselines.copy()
|
@@ -451,7 +440,25 @@ with tab3:
|
|
451 |
file_name='NFL_proj_export.csv',
|
452 |
mime='text/csv',
|
453 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
if st.button('Optimize'):
|
|
|
|
|
455 |
max_proj = 1000
|
456 |
max_own = 1000
|
457 |
total_proj = 0
|
@@ -708,4 +715,4 @@ with tab3:
|
|
708 |
|
709 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
710 |
|
711 |
-
|
|
|
293 |
dk_roo_raw_2 = load_dk_player_projections_2()
|
294 |
fd_roo_raw = load_fd_player_projections()
|
295 |
fd_roo_raw_2 = load_fd_player_projections_2()
|
296 |
+
dkid_dict, fdid_dict = set_export_ids()
|
297 |
+
for key in st.session_state.keys():
|
298 |
+
del st.session_state[key]
|
299 |
slate_var1 = st.radio("Which data are you loading?", ('Paydirt (Main)', 'Paydirt (Secondary)', 'User'), key='slate_var1')
|
300 |
site_var1 = st.selectbox("What site is the showdown on?", ('Draftkings', 'Fanduel'), key='site_var1')
|
301 |
if site_var1 == 'Draftkings':
|
|
|
332 |
min_sal1 = st.number_input('Min Salary', min_value = 45000, max_value = 59900, value = 59000, step = 100, key='min_sal1')
|
333 |
max_sal1 = st.number_input('Max Salary', min_value = 45000, max_value = 60000, value = 60000, step = 100, key='max_sal1')
|
334 |
with col2:
|
335 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
if contest_var1 == 'Small Field GPP':
|
337 |
if site_var1 == 'Draftkings':
|
338 |
ownframe = raw_baselines.copy()
|
|
|
440 |
file_name='NFL_proj_export.csv',
|
441 |
mime='text/csv',
|
442 |
)
|
443 |
+
|
444 |
+
with st.container():
|
445 |
+
if 'portfolio' in st.session_state:
|
446 |
+
st.dataframe(st.session_state.portfolio.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
447 |
+
if 'final_outcomes_export' in st.session_state:
|
448 |
+
st.download_button(
|
449 |
+
label="Export Tables",
|
450 |
+
data=convert_df_to_csv(st.session_state.final_outcomes_export),
|
451 |
+
file_name='MLB_optimals_export.csv',
|
452 |
+
mime='text/csv',
|
453 |
+
)
|
454 |
+
|
455 |
+
with st.container():
|
456 |
+
if 'player_freq' in st.session_state:
|
457 |
+
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(expose_format, precision=2), use_container_width = True)
|
458 |
+
|
459 |
if st.button('Optimize'):
|
460 |
+
for key in st.session_state.keys():
|
461 |
+
del st.session_state[key]
|
462 |
max_proj = 1000
|
463 |
max_own = 1000
|
464 |
total_proj = 0
|
|
|
715 |
|
716 |
st.session_state.player_freq = player_freq[['Player', 'Position', 'Team', 'Salary', 'Proj Own', 'Exposure']]
|
717 |
|
718 |
+
|