Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -474,6 +474,7 @@ with tab2:
|
|
474 |
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
475 |
st.session_state.team_freq['Freq'] = st.session_state.team_freq['Freq'].astype(int)
|
476 |
st.session_state.team_freq['Exposure'] = st.session_state.team_freq['Freq']/(1000)
|
|
|
477 |
|
478 |
if sim_site_var1 == 'Draftkings':
|
479 |
st.session_state.stack_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.Sim_Winner_Display.iloc[:,13:14].values, return_counts=True)),
|
@@ -483,6 +484,7 @@ with tab2:
|
|
483 |
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
484 |
st.session_state.stack_freq['Freq'] = st.session_state.stack_freq['Freq'].astype(int)
|
485 |
st.session_state.stack_freq['Exposure'] = st.session_state.stack_freq['Freq']/(1000)
|
|
|
486 |
|
487 |
with st.container():
|
488 |
st.dataframe(st.session_state.Sim_Winner_Frame)
|
@@ -505,7 +507,7 @@ with tab2:
|
|
505 |
st.download_button(
|
506 |
label="Export Exposures",
|
507 |
data=st.session_state.sp_freq.to_csv().encode('utf-8'),
|
508 |
-
file_name='
|
509 |
mime='text/csv',
|
510 |
key='sp'
|
511 |
)
|
@@ -515,7 +517,7 @@ with tab2:
|
|
515 |
st.download_button(
|
516 |
label="Export Exposures",
|
517 |
data=st.session_state.team_freq.to_csv().encode('utf-8'),
|
518 |
-
file_name='
|
519 |
mime='text/csv',
|
520 |
key='team'
|
521 |
)
|
@@ -525,7 +527,7 @@ with tab2:
|
|
525 |
st.download_button(
|
526 |
label="Export Exposures",
|
527 |
data=st.session_state.stack_freq.to_csv().encode('utf-8'),
|
528 |
-
file_name='
|
529 |
mime='text/csv',
|
530 |
key='stack'
|
531 |
)
|
|
|
474 |
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
475 |
st.session_state.team_freq['Freq'] = st.session_state.team_freq['Freq'].astype(int)
|
476 |
st.session_state.team_freq['Exposure'] = st.session_state.team_freq['Freq']/(1000)
|
477 |
+
st.session_state.team_freq = st.session_state.team_freq.drop('Freq')
|
478 |
|
479 |
if sim_site_var1 == 'Draftkings':
|
480 |
st.session_state.stack_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.Sim_Winner_Display.iloc[:,13:14].values, return_counts=True)),
|
|
|
484 |
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
485 |
st.session_state.stack_freq['Freq'] = st.session_state.stack_freq['Freq'].astype(int)
|
486 |
st.session_state.stack_freq['Exposure'] = st.session_state.stack_freq['Freq']/(1000)
|
487 |
+
st.session_state.stack_freq = st.session_state.stack_freq.drop('Freq')
|
488 |
|
489 |
with st.container():
|
490 |
st.dataframe(st.session_state.Sim_Winner_Frame)
|
|
|
507 |
st.download_button(
|
508 |
label="Export Exposures",
|
509 |
data=st.session_state.sp_freq.to_csv().encode('utf-8'),
|
510 |
+
file_name='sp_freq.csv',
|
511 |
mime='text/csv',
|
512 |
key='sp'
|
513 |
)
|
|
|
517 |
st.download_button(
|
518 |
label="Export Exposures",
|
519 |
data=st.session_state.team_freq.to_csv().encode('utf-8'),
|
520 |
+
file_name='team_freq.csv',
|
521 |
mime='text/csv',
|
522 |
key='team'
|
523 |
)
|
|
|
527 |
st.download_button(
|
528 |
label="Export Exposures",
|
529 |
data=st.session_state.stack_freq.to_csv().encode('utf-8'),
|
530 |
+
file_name='stack_freq.csv',
|
531 |
mime='text/csv',
|
532 |
key='stack'
|
533 |
)
|