Spaces:
Running
Running
James McCool
commited on
Commit
·
f6ecd24
1
Parent(s):
5b393f0
Refactor player ROO data handling in app.py to streamline the display logic by using a local variable for processed data, enhancing readability and maintaining functionality across different view types.
Browse files
app.py
CHANGED
@@ -324,25 +324,25 @@ with tab2:
|
|
324 |
|
325 |
if slate_type_var2 == 'Regular':
|
326 |
try:
|
327 |
-
|
328 |
except:
|
329 |
-
|
330 |
elif slate_type_var2 == 'Showdown':
|
331 |
try:
|
332 |
-
|
333 |
except:
|
334 |
-
|
335 |
if view_var == "Simple":
|
336 |
try:
|
337 |
-
|
338 |
-
st.dataframe(
|
339 |
except:
|
340 |
-
st.dataframe(
|
341 |
elif view_var == "Advanced":
|
342 |
try:
|
343 |
-
st.dataframe(
|
344 |
except:
|
345 |
-
st.dataframe(
|
346 |
|
347 |
with tab3:
|
348 |
st.header("Optimals")
|
|
|
324 |
|
325 |
if slate_type_var2 == 'Regular':
|
326 |
try:
|
327 |
+
player_roo_disp = player_roo_raw.drop(columns=['Site', 'Slate', 'pos_group', 'timestamp', 'player_ID'])
|
328 |
except:
|
329 |
+
player_roo_disp = player_roo_raw
|
330 |
elif slate_type_var2 == 'Showdown':
|
331 |
try:
|
332 |
+
player_roo_disp = player_roo_raw.drop(columns=['site', 'slate', 'version', 'timestamp'])
|
333 |
except:
|
334 |
+
player_roo_disp = player_roo_raw
|
335 |
if view_var == "Simple":
|
336 |
try:
|
337 |
+
player_roo_disp = player_roo_disp[['Player', 'Position', 'Salary', 'Median', 'Ceiling', 'Own']]
|
338 |
+
st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
339 |
except:
|
340 |
+
st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
341 |
elif view_var == "Advanced":
|
342 |
try:
|
343 |
+
st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
344 |
except:
|
345 |
+
st.dataframe(player_roo_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
|
346 |
|
347 |
with tab3:
|
348 |
st.header("Optimals")
|