Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
60a31d0
1
Parent(s):
495f7fd
Refactor data handling in Pivot Finder to improve clarity and maintainability. Introduced a temporary variable for the displayed DataFrame, enhancing readability of the code.
Browse files- src/streamlit_app.py +4 -3
src/streamlit_app.py
CHANGED
|
@@ -381,10 +381,11 @@ if selected_tab == 'Pivot Finder':
|
|
| 381 |
with displayholder.container():
|
| 382 |
if 'final_Proj' in st.session_state:
|
| 383 |
if view_var == 'Simple':
|
| 384 |
-
|
| 385 |
-
st.dataframe(
|
| 386 |
if view_var == 'Advanced':
|
| 387 |
-
st.
|
|
|
|
| 388 |
|
| 389 |
st.download_button(
|
| 390 |
label="Export Tables",
|
|
|
|
| 381 |
with displayholder.container():
|
| 382 |
if 'final_Proj' in st.session_state:
|
| 383 |
if view_var == 'Simple':
|
| 384 |
+
display_table = st.session_state['final_Proj'][['Position', 'Team', 'Salary', 'Median', 'Own', 'LevX']]
|
| 385 |
+
st.dataframe(display_table.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), use_container_width = True)
|
| 386 |
if view_var == 'Advanced':
|
| 387 |
+
display_table = st.session_state['final_Proj']
|
| 388 |
+
st.dataframe(display_table.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), use_container_width = True)
|
| 389 |
|
| 390 |
st.download_button(
|
| 391 |
label="Export Tables",
|