Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ dk_columns = ['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 's
|
|
| 40 |
fd_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']
|
| 41 |
|
| 42 |
@st.cache_data(ttl = 599)
|
| 43 |
-
def
|
| 44 |
|
| 45 |
collection = db["DK_MLB_seed_frame"]
|
| 46 |
cursor = collection.find()
|
|
@@ -49,6 +49,11 @@ def init_seed_frames():
|
|
| 49 |
raw_display = raw_display[['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
| 50 |
DK_seed = raw_display.to_numpy()
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
collection = db["FD_MLB_seed_frame"]
|
| 53 |
cursor = collection.find()
|
| 54 |
|
|
@@ -56,7 +61,7 @@ def init_seed_frames():
|
|
| 56 |
raw_display = raw_display[['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
| 57 |
FD_seed = raw_display.to_numpy()
|
| 58 |
|
| 59 |
-
return
|
| 60 |
|
| 61 |
@st.cache_data(ttl = 599)
|
| 62 |
def init_baselines():
|
|
@@ -129,7 +134,8 @@ def sim_contest(Sim_size, seed_frame, maps_dict, sharp_split, Contest_Size):
|
|
| 129 |
|
| 130 |
return Sim_Winners
|
| 131 |
|
| 132 |
-
DK_Seed
|
|
|
|
| 133 |
dk_raw, fd_raw = init_baselines()
|
| 134 |
|
| 135 |
tab1, tab2 = st.tabs(['Data Export', 'Contest Sims'])
|
|
@@ -140,7 +146,8 @@ with tab1:
|
|
| 140 |
st.cache_data.clear()
|
| 141 |
for key in st.session_state.keys():
|
| 142 |
del st.session_state[key]
|
| 143 |
-
DK_Seed
|
|
|
|
| 144 |
dk_raw, fd_raw = init_baselines()
|
| 145 |
|
| 146 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Other Main Slate'))
|
|
@@ -226,7 +233,8 @@ with tab2:
|
|
| 226 |
st.cache_data.clear()
|
| 227 |
for key in st.session_state.keys():
|
| 228 |
del st.session_state[key]
|
| 229 |
-
DK_Seed
|
|
|
|
| 230 |
dk_raw, fd_raw = init_baselines()
|
| 231 |
sim_slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Other Main Slate'), key='sim_slate_var1')
|
| 232 |
sim_site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'), key='sim_site_var1')
|
|
|
|
| 40 |
fd_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']
|
| 41 |
|
| 42 |
@st.cache_data(ttl = 599)
|
| 43 |
+
def init_DK_seed_frames():
|
| 44 |
|
| 45 |
collection = db["DK_MLB_seed_frame"]
|
| 46 |
cursor = collection.find()
|
|
|
|
| 49 |
raw_display = raw_display[['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
| 50 |
DK_seed = raw_display.to_numpy()
|
| 51 |
|
| 52 |
+
return DK_Seed
|
| 53 |
+
|
| 54 |
+
@st.cache_data(ttl = 599)
|
| 55 |
+
def init_FD_seed_frames():
|
| 56 |
+
|
| 57 |
collection = db["FD_MLB_seed_frame"]
|
| 58 |
cursor = collection.find()
|
| 59 |
|
|
|
|
| 61 |
raw_display = raw_display[['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
| 62 |
FD_seed = raw_display.to_numpy()
|
| 63 |
|
| 64 |
+
return FD_seed
|
| 65 |
|
| 66 |
@st.cache_data(ttl = 599)
|
| 67 |
def init_baselines():
|
|
|
|
| 134 |
|
| 135 |
return Sim_Winners
|
| 136 |
|
| 137 |
+
DK_Seed = init_DK_seed_frames()
|
| 138 |
+
FD_Seed = init_FD_seed_frames()
|
| 139 |
dk_raw, fd_raw = init_baselines()
|
| 140 |
|
| 141 |
tab1, tab2 = st.tabs(['Data Export', 'Contest Sims'])
|
|
|
|
| 146 |
st.cache_data.clear()
|
| 147 |
for key in st.session_state.keys():
|
| 148 |
del st.session_state[key]
|
| 149 |
+
DK_Seed = init_DK_seed_frames()
|
| 150 |
+
FD_Seed = init_FD_seed_frames()
|
| 151 |
dk_raw, fd_raw = init_baselines()
|
| 152 |
|
| 153 |
slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Other Main Slate'))
|
|
|
|
| 233 |
st.cache_data.clear()
|
| 234 |
for key in st.session_state.keys():
|
| 235 |
del st.session_state[key]
|
| 236 |
+
DK_Seed = init_DK_seed_frames()
|
| 237 |
+
FD_Seed = init_FD_seed_frames()
|
| 238 |
dk_raw, fd_raw = init_baselines()
|
| 239 |
sim_slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Other Main Slate'), key='sim_slate_var1')
|
| 240 |
sim_site_var1 = st.radio("What site are you working with?", ('Draftkings', 'Fanduel'), key='sim_site_var1')
|