Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,14 +39,14 @@ def init_conn():
|
|
39 |
raw_display = pd.DataFrame(list(cursor))
|
40 |
raw_display = raw_display[['salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']]
|
41 |
FD_seed = raw_display.to_numpy()
|
|
|
|
|
42 |
|
43 |
gc_con = gspread.service_account_from_dict(credentials, scope)
|
44 |
|
45 |
-
return gc_con, client, db, DK_seed, FD_seed
|
46 |
-
|
47 |
-
gcservice_account, client, db, DK_seed, FD_seedb = init_conn()
|
48 |
|
49 |
-
MLB_Data =
|
50 |
|
51 |
percentages_format = {'Exposure': '{:.2%}'}
|
52 |
dk_columns = [['salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3']]
|
@@ -133,12 +133,12 @@ with tab1:
|
|
133 |
if site_var1 == 'Draftkings':
|
134 |
|
135 |
working_seed = DK_seed
|
136 |
-
|
137 |
-
|
138 |
data_export_display = pd.DataFrame(working_seed[0:1000], columns=column_names)
|
139 |
st.session_state.data_export_display = data_export_display.copy()
|
140 |
|
141 |
-
#
|
142 |
|
143 |
with st.container():
|
144 |
if 'data_export_display' in st.session_state:
|
@@ -150,12 +150,12 @@ with tab1:
|
|
150 |
elif site_var1 == 'Fanduel':
|
151 |
|
152 |
working_seed = FD_seed
|
153 |
-
|
154 |
-
|
155 |
data_export_display = pd.DataFrame(working_seed[0:1000], columns=column_names)
|
156 |
st.session_state.data_export_display = data_export_display.copy()
|
157 |
|
158 |
-
#
|
159 |
|
160 |
with st.container():
|
161 |
if 'data_export_display' in st.session_state:
|
|
|
39 |
raw_display = pd.DataFrame(list(cursor))
|
40 |
raw_display = raw_display[['salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']]
|
41 |
FD_seed = raw_display.to_numpy()
|
42 |
+
|
43 |
+
MLB_Data = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=340831852'
|
44 |
|
45 |
gc_con = gspread.service_account_from_dict(credentials, scope)
|
46 |
|
47 |
+
return gc_con, client, db, DK_seed, FD_seed, MLB_Data
|
|
|
|
|
48 |
|
49 |
+
gcservice_account, client, db, DK_seed, FD_seed, MLB_Data = init_conn()
|
50 |
|
51 |
percentages_format = {'Exposure': '{:.2%}'}
|
52 |
dk_columns = [['salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3']]
|
|
|
133 |
if site_var1 == 'Draftkings':
|
134 |
|
135 |
working_seed = DK_seed
|
136 |
+
working_seed_parse = working_seed[np.isin(working_seed[:, 2], team_var2)]
|
137 |
+
working_seed_parse = working_seed[np.isin(working_seed[:, 3], stack_var2)]
|
138 |
data_export_display = pd.DataFrame(working_seed[0:1000], columns=column_names)
|
139 |
st.session_state.data_export_display = data_export_display.copy()
|
140 |
|
141 |
+
# st.session_state.data_export_freq = calculate_value_frequencies(st.session_state.data_export)
|
142 |
|
143 |
with st.container():
|
144 |
if 'data_export_display' in st.session_state:
|
|
|
150 |
elif site_var1 == 'Fanduel':
|
151 |
|
152 |
working_seed = FD_seed
|
153 |
+
working_seed_parse = working_seed[np.isin(working_seed[:, 2], team_var2)]
|
154 |
+
working_seed_parse = working_seed[np.isin(working_seed[:, 3], stack_var2)]
|
155 |
data_export_display = pd.DataFrame(working_seed[0:1000], columns=column_names)
|
156 |
st.session_state.data_export_display = data_export_display.copy()
|
157 |
|
158 |
+
# st.session_state.data_export_freq = calculate_value_frequencies(st.session_state.data_export)
|
159 |
|
160 |
with st.container():
|
161 |
if 'data_export_display' in st.session_state:
|