James McCool
commited on
Commit
·
00737ec
1
Parent(s):
fc0fbd1
coinvert to df first, then csv
Browse files
app.py
CHANGED
|
@@ -564,21 +564,20 @@ if selected_tab == 'Data Load':
|
|
| 564 |
if st.button("Load from Database after inserting site CSV"):
|
| 565 |
if site_var == 'Draftkings':
|
| 566 |
portfolio_file = init_DK_NFL_lineups(type_var, 'Main', 'proj', 50, dk_nfl_showdown_db_translation, 1000, [])
|
| 567 |
-
|
| 568 |
-
portfolio_file =
|
| 569 |
if 'portfolio' in st.session_state:
|
| 570 |
del st.session_state['portfolio']
|
| 571 |
if 'export_portfolio' in st.session_state:
|
| 572 |
del st.session_state['export_portfolio']
|
| 573 |
else:
|
| 574 |
portfolio_file = init_FD_NFL_lineups(type_var, 'Main', 'proj', 50, fd_nfl_showdown_db_translation, 1000, [])
|
| 575 |
-
|
| 576 |
-
portfolio_file =
|
| 577 |
if 'portfolio' in st.session_state:
|
| 578 |
del st.session_state['portfolio']
|
| 579 |
if 'export_portfolio' in st.session_state:
|
| 580 |
del st.session_state['export_portfolio']
|
| 581 |
-
st.write(portfolio_file)
|
| 582 |
|
| 583 |
elif upload_toggle == 'SaberSim (Just IDs)' or upload_toggle == 'Draftkings/Fanduel (Names + IDs)':
|
| 584 |
portfolio_file = st.file_uploader("Upload Portfolio File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
|
|
|
|
| 564 |
if st.button("Load from Database after inserting site CSV"):
|
| 565 |
if site_var == 'Draftkings':
|
| 566 |
portfolio_file = init_DK_NFL_lineups(type_var, 'Main', 'proj', 50, dk_nfl_showdown_db_translation, 1000, [])
|
| 567 |
+
portfolio_df = pd.DataFrame(portfolio_file)
|
| 568 |
+
portfolio_file = portfolio_df.to_csv(index=False)
|
| 569 |
if 'portfolio' in st.session_state:
|
| 570 |
del st.session_state['portfolio']
|
| 571 |
if 'export_portfolio' in st.session_state:
|
| 572 |
del st.session_state['export_portfolio']
|
| 573 |
else:
|
| 574 |
portfolio_file = init_FD_NFL_lineups(type_var, 'Main', 'proj', 50, fd_nfl_showdown_db_translation, 1000, [])
|
| 575 |
+
portfolio_df = pd.DataFrame(portfolio_file)
|
| 576 |
+
portfolio_file = portfolio_df.to_csv(index=False)
|
| 577 |
if 'portfolio' in st.session_state:
|
| 578 |
del st.session_state['portfolio']
|
| 579 |
if 'export_portfolio' in st.session_state:
|
| 580 |
del st.session_state['export_portfolio']
|
|
|
|
| 581 |
|
| 582 |
elif upload_toggle == 'SaberSim (Just IDs)' or upload_toggle == 'Draftkings/Fanduel (Names + IDs)':
|
| 583 |
portfolio_file = st.file_uploader("Upload Portfolio File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
|