James McCool
commited on
Commit
·
053e7df
1
Parent(s):
00f9a6c
Remove debug output for salary dictionary in app.py and correct player exposure percentage calculation in create_player_comparison.py
Browse files- Eliminated the print statement displaying the salary dictionary in app.py to streamline the output and reduce unnecessary session state visibility.
- Updated the calculation of player exposure percentages in create_player_comparison.py to use the correct DataFrame subset, ensuring accurate representation of player data.
- app.py +0 -1
- global_func/create_player_comparison.py +1 -1
app.py
CHANGED
@@ -146,7 +146,6 @@ with tab1:
|
|
146 |
st.session_state['salary_dict'] = st.session_state['info_maps']['salary_dict']
|
147 |
st.session_state['team_dict'] = st.session_state['info_maps']['team_dict']
|
148 |
st.session_state['pos_dict'] = st.session_state['info_maps']['position_dict']
|
149 |
-
st.write(st.session_state['salary_dict'])
|
150 |
|
151 |
with tab2:
|
152 |
excluded_cols = ['BaseName', 'EntryCount']
|
|
|
146 |
st.session_state['salary_dict'] = st.session_state['info_maps']['salary_dict']
|
147 |
st.session_state['team_dict'] = st.session_state['info_maps']['team_dict']
|
148 |
st.session_state['pos_dict'] = st.session_state['info_maps']['position_dict']
|
|
|
149 |
|
150 |
with tab2:
|
151 |
excluded_cols = ['BaseName', 'EntryCount']
|
global_func/create_player_comparison.py
CHANGED
@@ -14,7 +14,7 @@ def create_player_comparison(df: pd.DataFrame, player_columns: list, entrants: l
|
|
14 |
overall_players = pd.Series(list(df[df['BaseName'] == each_user][player_columns].values.flatten())).value_counts()
|
15 |
|
16 |
set_frame = overall_players.to_frame().reset_index().rename(columns={'index': 'Player', 'count': 'Count'})
|
17 |
-
set_frame['Percent'] = set_frame['Count'] / len(
|
18 |
set_frame = set_frame[['Player', 'Percent']]
|
19 |
set_frame = set_frame.rename(columns={'Percent': f'Exposure {each_user}'})
|
20 |
player_frame = pd.merge(player_frame, set_frame, on='Player', how='outer')
|
|
|
14 |
overall_players = pd.Series(list(df[df['BaseName'] == each_user][player_columns].values.flatten())).value_counts()
|
15 |
|
16 |
set_frame = overall_players.to_frame().reset_index().rename(columns={'index': 'Player', 'count': 'Count'})
|
17 |
+
set_frame['Percent'] = set_frame['Count'] / len(df[df['BaseName'] == each_user])
|
18 |
set_frame = set_frame[['Player', 'Percent']]
|
19 |
set_frame = set_frame.rename(columns={'Percent': f'Exposure {each_user}'})
|
20 |
player_frame = pd.merge(player_frame, set_frame, on='Player', how='outer')
|