Spaces:
Running
Running
James McCool
commited on
Commit
·
89881fc
1
Parent(s):
0cd4d7f
Add ROO (Roster Optimization Output) functionality for NBA with site-specific builds
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import numpy as np
|
|
| 4 |
import pandas as pd
|
| 5 |
import time
|
| 6 |
from fuzzywuzzy import process
|
|
|
|
| 7 |
|
| 8 |
def load_file(upload):
|
| 9 |
if upload is not None:
|
|
@@ -66,4 +67,24 @@ with tab1:
|
|
| 66 |
|
| 67 |
with tab2:
|
| 68 |
if st.button('Clear data', key='reset2'):
|
| 69 |
-
st.session_state.clear()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import time
|
| 6 |
from fuzzywuzzy import process
|
| 7 |
+
from function_hold.NBA_functions import DK_NBA_ROO_Build, FD_NBA_ROO_Build
|
| 8 |
|
| 9 |
def load_file(upload):
|
| 10 |
if upload is not None:
|
|
|
|
| 67 |
|
| 68 |
with tab2:
|
| 69 |
if st.button('Clear data', key='reset2'):
|
| 70 |
+
st.session_state.clear()
|
| 71 |
+
site_var = st.selectbox("Select Site", ["Draftkings", "Fanduel"])
|
| 72 |
+
if projections_file:
|
| 73 |
+
if st.button('Build ROO'):
|
| 74 |
+
if sport_var == "NBA":
|
| 75 |
+
if site_var == "Draftkings":
|
| 76 |
+
disp_file = DK_NBA_ROO_Build(projections)
|
| 77 |
+
elif site_var == "Fanduel":
|
| 78 |
+
disp_file = FD_NBA_ROO_Build(projections)
|
| 79 |
+
elif sport_var == "NFL":
|
| 80 |
+
if site_var == "Draftkings":
|
| 81 |
+
disp_file = DK_NFL_ROO_Build(projections)
|
| 82 |
+
elif site_var == "Fanduel":
|
| 83 |
+
disp_file = FD_NFL_ROO_Build(projections)
|
| 84 |
+
elif sport_var == "MLB":
|
| 85 |
+
if site_var == "Draftkings":
|
| 86 |
+
disp_file = DK_MLB_ROO_Build(projections)
|
| 87 |
+
elif site_var == "Fanduel":
|
| 88 |
+
disp_file = FD_MLB_ROO_Build(projections)
|
| 89 |
+
|
| 90 |
+
st.dataframe(disp_file)
|