James McCool commited on
Commit
3571793
·
1 Parent(s): cf9e7c2

Implement conditional display logic in app.py for 'Simple' and 'Advanced' views, allowing users to customize the dataframe output based on their preferences, enhancing data presentation and user experience.

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -158,7 +158,11 @@ with tab2:
158
  display_data = display_data[display_data['slate'] == 'FD SD1']
159
 
160
  display_data = display_data.drop(columns=['site', 'slate', 'version', 'timestamp'])
161
- st.dataframe(display_data.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
 
 
 
 
162
 
163
  with tab3:
164
  with st.expander("Info and Filters"):
 
158
  display_data = display_data[display_data['slate'] == 'FD SD1']
159
 
160
  display_data = display_data.drop(columns=['site', 'slate', 'version', 'timestamp'])
161
+ if view_var == "Simple":
162
+ display_data = display_data[['Player', 'Position', 'Salary', 'Median', 'Ceiling', 'Own']]
163
+ st.dataframe(display_data.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
164
+ elif view_var == "Advanced":
165
+ st.dataframe(display_data.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True, hide_index=True)
166
 
167
  with tab3:
168
  with st.expander("Info and Filters"):