James McCool
commited on
Commit
·
c462820
1
Parent(s):
10aa498
Add salary mapping for players in Contest Analysis tab of app.py
Browse files- Integrated salary data into the player frames by mapping player names to their corresponding salaries from the session state dictionary.
- Enhanced the player experience comparison by including salary information, improving the analysis capabilities within the Contest Analysis section.
app.py
CHANGED
|
@@ -772,7 +772,9 @@ if selected_tab == 'Contest Analysis':
|
|
| 772 |
hold_frame['Pos'] = 'C'
|
| 773 |
else:
|
| 774 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
|
|
|
| 775 |
player_exp_comp.insert(1, 'Pos', hold_frame['Pos'])
|
|
|
|
| 776 |
player_exp_comp = player_exp_comp.dropna(subset=['Pos'])
|
| 777 |
if pos_select:
|
| 778 |
position_mask = player_exp_comp['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|
|
@@ -790,7 +792,9 @@ if selected_tab == 'Contest Analysis':
|
|
| 790 |
hold_frame['Pos'] = 'NAS'
|
| 791 |
else:
|
| 792 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
|
|
|
| 793 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
|
|
|
| 794 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
| 795 |
if pos_select:
|
| 796 |
position_mask = st.session_state['player_frame']['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|
|
@@ -811,6 +815,8 @@ if selected_tab == 'Contest Analysis':
|
|
| 811 |
else:
|
| 812 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
| 813 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
|
|
|
|
|
|
| 814 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
| 815 |
if pos_select:
|
| 816 |
position_mask = st.session_state['player_frame']['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|
|
|
|
| 772 |
hold_frame['Pos'] = 'C'
|
| 773 |
else:
|
| 774 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
| 775 |
+
hold_frame['Salary'] = hold_frame['Player'].map(st.session_state['map_dict']['salary_dict'])
|
| 776 |
player_exp_comp.insert(1, 'Pos', hold_frame['Pos'])
|
| 777 |
+
player_exp_comp.insert(2, 'Salary', hold_frame['Salary'])
|
| 778 |
player_exp_comp = player_exp_comp.dropna(subset=['Pos'])
|
| 779 |
if pos_select:
|
| 780 |
position_mask = player_exp_comp['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|
|
|
|
| 792 |
hold_frame['Pos'] = 'NAS'
|
| 793 |
else:
|
| 794 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
| 795 |
+
hold_frame['Salary'] = hold_frame['Player'].map(st.session_state['map_dict']['salary_dict'])
|
| 796 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
| 797 |
+
st.session_state['player_frame'].insert(2, 'Salary', hold_frame['Salary'])
|
| 798 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
| 799 |
if pos_select:
|
| 800 |
position_mask = st.session_state['player_frame']['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|
|
|
|
| 815 |
else:
|
| 816 |
hold_frame['Pos'] = hold_frame['Player'].map(st.session_state['map_dict']['pos_map'])
|
| 817 |
st.session_state['player_frame'].insert(1, 'Pos', hold_frame['Pos'])
|
| 818 |
+
hold_frame['Salary'] = hold_frame['Player'].map(st.session_state['map_dict']['salary_dict'])
|
| 819 |
+
st.session_state['player_frame'].insert(2, 'Salary', hold_frame['Salary'])
|
| 820 |
st.session_state['player_frame'] = st.session_state['player_frame'].dropna(subset=['Pos'])
|
| 821 |
if pos_select:
|
| 822 |
position_mask = st.session_state['player_frame']['Pos'].apply(lambda x: any(pos in x for pos in pos_select))
|