Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -154,7 +154,8 @@ with tab1:
|
|
154 |
with st.container():
|
155 |
if 'data_export_freq' in st.session_state:
|
156 |
st.dataframe(st.session_state.data_export_freq.style.format(percentages_format, precision=2), height=500, use_container_width=True)
|
157 |
-
|
|
|
158 |
st.session_state.data_export = working_seed.copy()
|
159 |
if 'data_export' in st.session_state:
|
160 |
st.download_button(
|
@@ -167,26 +168,29 @@ with tab1:
|
|
167 |
elif site_var1 == 'Fanduel':
|
168 |
|
169 |
working_seed = init_FD_seed_frame()
|
170 |
-
working_seed_parse = working_seed[np.isin(working_seed[:, 2], team_var2)]
|
171 |
-
working_seed_parse = working_seed[np.isin(working_seed[:, 3], stack_var2)]
|
172 |
-
data_export_display =
|
173 |
st.session_state.data_export_display = data_export_display.copy()
|
174 |
-
st.session_state.data_export = working_seed.copy()
|
175 |
-
st.session_state.data_export_freq = calculate_value_frequencies(my_array)
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
label="Export optimals set",
|
180 |
-
data=convert_df(st.session_state.data_export),
|
181 |
-
file_name='MLB_optimals_export.csv',
|
182 |
-
mime='text/csv',
|
183 |
-
)
|
184 |
with st.container():
|
185 |
if 'data_export_display' in st.session_state:
|
186 |
st.dataframe(st.session_state.data_export_display.style.format(precision=2), height=500, use_container_width=True)
|
187 |
with st.container():
|
188 |
if 'data_export_freq' in st.session_state:
|
189 |
st.dataframe(st.session_state.data_export_freq.style.format(percentages_format, precision=2), height=500, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
with tab2:
|
192 |
col1, col2 = st.columns([1, 7])
|
|
|
154 |
with st.container():
|
155 |
if 'data_export_freq' in st.session_state:
|
156 |
st.dataframe(st.session_state.data_export_freq.style.format(percentages_format, precision=2), height=500, use_container_width=True)
|
157 |
+
|
158 |
+
if st.button("Prepare data export", key='data_export'):
|
159 |
st.session_state.data_export = working_seed.copy()
|
160 |
if 'data_export' in st.session_state:
|
161 |
st.download_button(
|
|
|
168 |
elif site_var1 == 'Fanduel':
|
169 |
|
170 |
working_seed = init_FD_seed_frame()
|
171 |
+
# working_seed_parse = working_seed[np.isin(working_seed[:, 2], team_var2)]
|
172 |
+
# working_seed_parse = working_seed[np.isin(working_seed[:, 3], stack_var2)]
|
173 |
+
data_export_display = pd.DataFrame(working_seed[0:1000], columns=column_names)
|
174 |
st.session_state.data_export_display = data_export_display.copy()
|
|
|
|
|
175 |
|
176 |
+
# st.session_state.data_export_freq = calculate_value_frequencies(st.session_state.data_export)
|
177 |
+
|
|
|
|
|
|
|
|
|
|
|
178 |
with st.container():
|
179 |
if 'data_export_display' in st.session_state:
|
180 |
st.dataframe(st.session_state.data_export_display.style.format(precision=2), height=500, use_container_width=True)
|
181 |
with st.container():
|
182 |
if 'data_export_freq' in st.session_state:
|
183 |
st.dataframe(st.session_state.data_export_freq.style.format(percentages_format, precision=2), height=500, use_container_width=True)
|
184 |
+
|
185 |
+
if st.button("Prepare data export", key='data_export'):
|
186 |
+
st.session_state.data_export = working_seed.copy()
|
187 |
+
if 'data_export' in st.session_state:
|
188 |
+
st.download_button(
|
189 |
+
label="Export optimals set",
|
190 |
+
data=convert_df(st.session_state.data_export),
|
191 |
+
file_name='MLB_optimals_export.csv',
|
192 |
+
mime='text/csv',
|
193 |
+
)
|
194 |
|
195 |
with tab2:
|
196 |
col1, col2 = st.columns([1, 7])
|