Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -198,7 +198,12 @@ with tab1:
|
|
| 198 |
|
| 199 |
with st.container():
|
| 200 |
if 'data_export_display' in st.session_state:
|
| 201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
if st.button("Prepare data export", key='data_export'):
|
| 204 |
data_export = st.session_state.working_seed.copy()
|
|
@@ -234,8 +239,7 @@ with tab2:
|
|
| 234 |
elif contest_var1 == 'Large':
|
| 235 |
Contest_Size = 10000
|
| 236 |
elif contest_var1 == 'Custom':
|
| 237 |
-
Contest_Size = st.number_input("Insert contest size", value=
|
| 238 |
-
Contest_Size = Contest_Size.astype(int)
|
| 239 |
strength_var1 = st.selectbox("How sharp is the field in the contest?", ('Very', 'Above Average', 'Average', 'Below Average', 'Not Very'))
|
| 240 |
if strength_var1 == 'Not Very':
|
| 241 |
sharp_split = 500000
|
|
@@ -471,13 +475,23 @@ with tab2:
|
|
| 471 |
st.session_state.stack_freq['Exposure'] = st.session_state.stack_freq['Freq']/(1000)
|
| 472 |
|
| 473 |
with st.container():
|
| 474 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 475 |
|
| 476 |
with st.container():
|
| 477 |
tab1, tab2, tab3, tab4 = st.tabs(['Overall Exposures', 'SP Exposures', 'Team Exposures', 'Stack Size Exposures'])
|
| 478 |
with tab1:
|
| 479 |
if 'player_freq' in st.session_state:
|
| 480 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
st.download_button(
|
| 482 |
label="Export Exposures",
|
| 483 |
data=st.session_state.player_freq.to_csv().encode('utf-8'),
|
|
@@ -487,7 +501,12 @@ with tab2:
|
|
| 487 |
)
|
| 488 |
with tab2:
|
| 489 |
if 'sp_freq' in st.session_state:
|
| 490 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
st.download_button(
|
| 492 |
label="Export Exposures",
|
| 493 |
data=st.session_state.sp_freq.to_csv().encode('utf-8'),
|
|
@@ -497,7 +516,12 @@ with tab2:
|
|
| 497 |
)
|
| 498 |
with tab3:
|
| 499 |
if 'team_freq' in st.session_state:
|
| 500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
st.download_button(
|
| 502 |
label="Export Exposures",
|
| 503 |
data=st.session_state.team_freq.to_csv().encode('utf-8'),
|
|
@@ -507,7 +531,12 @@ with tab2:
|
|
| 507 |
)
|
| 508 |
with tab4:
|
| 509 |
if 'stack_freq' in st.session_state:
|
| 510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
st.download_button(
|
| 512 |
label="Export Exposures",
|
| 513 |
data=st.session_state.stack_freq.to_csv().encode('utf-8'),
|
|
|
|
| 198 |
|
| 199 |
with st.container():
|
| 200 |
if 'data_export_display' in st.session_state:
|
| 201 |
+
try:
|
| 202 |
+
st.table(st.session_state.data_export_display)
|
| 203 |
+
except:
|
| 204 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 205 |
+
time.sleep(5)
|
| 206 |
+
st.table(st.session_state.data_export_display)
|
| 207 |
|
| 208 |
if st.button("Prepare data export", key='data_export'):
|
| 209 |
data_export = st.session_state.working_seed.copy()
|
|
|
|
| 239 |
elif contest_var1 == 'Large':
|
| 240 |
Contest_Size = 10000
|
| 241 |
elif contest_var1 == 'Custom':
|
| 242 |
+
Contest_Size = st.number_input("Insert contest size", value=100, placeholder="Type a number under 10,000...")
|
|
|
|
| 243 |
strength_var1 = st.selectbox("How sharp is the field in the contest?", ('Very', 'Above Average', 'Average', 'Below Average', 'Not Very'))
|
| 244 |
if strength_var1 == 'Not Very':
|
| 245 |
sharp_split = 500000
|
|
|
|
| 475 |
st.session_state.stack_freq['Exposure'] = st.session_state.stack_freq['Freq']/(1000)
|
| 476 |
|
| 477 |
with st.container():
|
| 478 |
+
try:
|
| 479 |
+
st.dataframe(st.session_state.Sim_Winner_Frame)
|
| 480 |
+
except:
|
| 481 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 482 |
+
time.sleep(5)
|
| 483 |
+
st.dataframe(st.session_state.Sim_Winner_Frame)
|
| 484 |
|
| 485 |
with st.container():
|
| 486 |
tab1, tab2, tab3, tab4 = st.tabs(['Overall Exposures', 'SP Exposures', 'Team Exposures', 'Stack Size Exposures'])
|
| 487 |
with tab1:
|
| 488 |
if 'player_freq' in st.session_state:
|
| 489 |
+
try:
|
| 490 |
+
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 491 |
+
except:
|
| 492 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 493 |
+
time.sleep(5)
|
| 494 |
+
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 495 |
st.download_button(
|
| 496 |
label="Export Exposures",
|
| 497 |
data=st.session_state.player_freq.to_csv().encode('utf-8'),
|
|
|
|
| 501 |
)
|
| 502 |
with tab2:
|
| 503 |
if 'sp_freq' in st.session_state:
|
| 504 |
+
try:
|
| 505 |
+
st.dataframe(st.session_state.sp_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 506 |
+
except:
|
| 507 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 508 |
+
time.sleep(5)
|
| 509 |
+
st.dataframe(st.session_state.sp_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 510 |
st.download_button(
|
| 511 |
label="Export Exposures",
|
| 512 |
data=st.session_state.sp_freq.to_csv().encode('utf-8'),
|
|
|
|
| 516 |
)
|
| 517 |
with tab3:
|
| 518 |
if 'team_freq' in st.session_state:
|
| 519 |
+
try:
|
| 520 |
+
st.dataframe(st.session_state.team_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 521 |
+
except:
|
| 522 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 523 |
+
time.sleep(5)
|
| 524 |
+
st.dataframe(st.session_state.team_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 525 |
st.download_button(
|
| 526 |
label="Export Exposures",
|
| 527 |
data=st.session_state.team_freq.to_csv().encode('utf-8'),
|
|
|
|
| 531 |
)
|
| 532 |
with tab4:
|
| 533 |
if 'stack_freq' in st.session_state:
|
| 534 |
+
try:
|
| 535 |
+
st.dataframe(st.session_state.stack_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 536 |
+
except:
|
| 537 |
+
st.write("resources low, waiting 5 seconds and trying again")
|
| 538 |
+
time.sleep(5)
|
| 539 |
+
st.dataframe(st.session_state.stack_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 540 |
st.download_button(
|
| 541 |
label="Export Exposures",
|
| 542 |
data=st.session_state.stack_freq.to_csv().encode('utf-8'),
|