Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
bb691ba
1
Parent(s):
695636a
added export ids to display portfolio
Browse files
app.py
CHANGED
|
@@ -436,6 +436,14 @@ with tab2:
|
|
| 436 |
st.session_state.working_seed = fd_lineups.copy()
|
| 437 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:lineup_num_var], columns=column_names)
|
| 438 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
with st.container():
|
| 440 |
if st.button("Reset Optimals", key='reset3'):
|
| 441 |
for key in st.session_state.keys():
|
|
@@ -448,7 +456,7 @@ with tab2:
|
|
| 448 |
st.dataframe(st.session_state.data_export_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height=500, use_container_width = True)
|
| 449 |
st.download_button(
|
| 450 |
label="Export display optimals",
|
| 451 |
-
data=convert_df(
|
| 452 |
file_name='NBA_display_optimals.csv',
|
| 453 |
mime='text/csv',
|
| 454 |
)
|
|
|
|
| 436 |
st.session_state.working_seed = fd_lineups.copy()
|
| 437 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:lineup_num_var], columns=column_names)
|
| 438 |
|
| 439 |
+
export_file = st.session_state.data_export_display.copy()
|
| 440 |
+
if site_var1 == 'Draftkings':
|
| 441 |
+
for col_idx in range(8):
|
| 442 |
+
export_file[:, col_idx] = np.array([id_dict.get(player, player) for player in export_file[:, col_idx]])
|
| 443 |
+
elif site_var1 == 'Fanduel':
|
| 444 |
+
for col_idx in range(9):
|
| 445 |
+
export_file[:, col_idx] = np.array([id_dict.get(player, player) for player in export_file[:, col_idx]])
|
| 446 |
+
|
| 447 |
with st.container():
|
| 448 |
if st.button("Reset Optimals", key='reset3'):
|
| 449 |
for key in st.session_state.keys():
|
|
|
|
| 456 |
st.dataframe(st.session_state.data_export_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height=500, use_container_width = True)
|
| 457 |
st.download_button(
|
| 458 |
label="Export display optimals",
|
| 459 |
+
data=convert_df(export_file),
|
| 460 |
file_name='NBA_display_optimals.csv',
|
| 461 |
mime='text/csv',
|
| 462 |
)
|