James McCool
commited on
Commit
·
0406a82
1
Parent(s):
8b08b1a
Update player position handling in app.py for GOLF sport case
Browse files- Modified the logic for setting player positions to handle the 'GOLF' sport case by assigning a fixed position of 'G'.
- Retained existing functionality for other sports by mapping player positions from the provided dictionary.
- Improved clarity in the code while maintaining the overall functionality of player frame processing.
app.py
CHANGED
@@ -240,7 +240,10 @@ with tab2:
|
|
240 |
|
241 |
st.session_state['player_frame'] = create_player_exposures(working_df, player_columns)
|
242 |
hold_frame = st.session_state['player_frame'].copy()
|
243 |
-
|
|
|
|
|
|
|
244 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
245 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
246 |
if pos_select:
|
|
|
240 |
|
241 |
st.session_state['player_frame'] = create_player_exposures(working_df, player_columns)
|
242 |
hold_frame = st.session_state['player_frame'].copy()
|
243 |
+
if sport_select == 'GOLF':
|
244 |
+
hold_frame['Pos'] = 'G'
|
245 |
+
else:
|
246 |
+
hold_frame['Pos'] = hold_frame['Player'].map(map_dict['pos_map'])
|
247 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
248 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
249 |
if pos_select:
|