James McCool
commited on
Commit
·
0295f53
1
Parent(s):
9c09ce3
Add debug output for salary calculations in app.py
Browse files- Introduced print statements to display sample row values and individual player salaries during salary calculations, enhancing visibility for debugging purposes.
- This change aids in verifying the accuracy of salary computations and improves overall data handling during runtime.
app.py
CHANGED
@@ -184,6 +184,16 @@ with tab2:
|
|
184 |
working_df['salary'] = working_df.apply(lambda row: sum(st.session_state['salary_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
185 |
working_df['actual_fpts'] = working_df.apply(lambda row: sum(st.session_state['actual_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
186 |
working_df['actual_own'] = working_df.apply(lambda row: sum(st.session_state['ownership_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
188 |
lambda row: ','.join(sorted(row.values)),
|
189 |
axis=1
|
|
|
184 |
working_df['salary'] = working_df.apply(lambda row: sum(st.session_state['salary_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
185 |
working_df['actual_fpts'] = working_df.apply(lambda row: sum(st.session_state['actual_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
186 |
working_df['actual_own'] = working_df.apply(lambda row: sum(st.session_state['ownership_dict'].get(player, 0) for player in row[st.session_state['player_columns']]), axis=1)
|
187 |
+
print("Sample row values:")
|
188 |
+
print(working_df.iloc[0][st.session_state['player_columns']])
|
189 |
+
print("Sample salary calculation:")
|
190 |
+
sample_row = working_df.iloc[0]
|
191 |
+
sample_salary = sum(st.session_state['salary_dict'].get(player, 0) for player in sample_row[st.session_state['player_columns']])
|
192 |
+
print(f"Sample salary: {sample_salary}")
|
193 |
+
print("Individual player salaries:")
|
194 |
+
for player in sample_row[st.session_state['player_columns']]:
|
195 |
+
salary = st.session_state['salary_dict'].get(player, 0)
|
196 |
+
print(f" {player}: {salary}")
|
197 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
198 |
lambda row: ','.join(sorted(row.values)),
|
199 |
axis=1
|