James McCool
commited on
Commit
·
c1c7c16
1
Parent(s):
50337eb
Sort player exposure dataframe by overall exposure in app.py
Browse files- Updated the logic to sort the player exposure dataframe by 'Exposure Overall' in descending order before applying the background gradient and formatting.
- This change enhances the clarity of data presentation, allowing users to easily identify players with the highest exposure.
app.py
CHANGED
@@ -212,7 +212,7 @@ with tab2:
|
|
212 |
else:
|
213 |
st.session_state['player_frame'] = pd.merge(st.session_state['player_frame'], set_frame, on='Player', how='outer')
|
214 |
count_var += 1
|
215 |
-
st.dataframe(st.session_state['player_frame'].style.background_gradient(cmap='RdYlGn').format(player_exposure_format, precision=2), hide_index=True)
|
216 |
with tab2:
|
217 |
stack_counts = pd.Series(list(working_df['stack'])).value_counts()
|
218 |
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack', 'count': 'Count'})
|
|
|
212 |
else:
|
213 |
st.session_state['player_frame'] = pd.merge(st.session_state['player_frame'], set_frame, on='Player', how='outer')
|
214 |
count_var += 1
|
215 |
+
st.dataframe(st.session_state['player_frame'].sort_values(by='Exposure Overall', ascending=False).style.background_gradient(cmap='RdYlGn').format(player_exposure_format, precision=2), hide_index=True)
|
216 |
with tab2:
|
217 |
stack_counts = pd.Series(list(working_df['stack'])).value_counts()
|
218 |
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack', 'count': 'Count'})
|