James McCool
commited on
Commit
·
abd1ae1
1
Parent(s):
3894e93
Update salary and actual fantasy points calculations in app.py to apply a 1.5x multiplier for the first player in each row. This change enhances the accuracy of player evaluations in the data processing workflow.
Browse files
app.py
CHANGED
@@ -211,8 +211,18 @@ with tab2:
|
|
211 |
).most_common(1)[0][1] if any(map_dict['team_map'].get(player, '') for player in row[2:]) else '',
|
212 |
axis=1
|
213 |
)
|
214 |
-
|
215 |
-
working_df['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
working_df['actual_own'] = working_df.apply(lambda row: sum(st.session_state['ownership_dict'].get(player, 0) for player in row), axis=1)
|
217 |
working_df['sorted'] = working_df[player_columns].apply(
|
218 |
lambda row: ','.join(sorted(row.values)),
|
|
|
211 |
).most_common(1)[0][1] if any(map_dict['team_map'].get(player, '') for player in row[2:]) else '',
|
212 |
axis=1
|
213 |
)
|
214 |
+
# Modified salary calculation with 1.5x multiplier for first player
|
215 |
+
working_df['salary'] = working_df.apply(
|
216 |
+
lambda row: (map_dict['salary_map'].get(row[2], 0) * 1.5) +
|
217 |
+
sum(map_dict['salary_map'].get(player, 0) for player in row[3:]),
|
218 |
+
axis=1
|
219 |
+
)
|
220 |
+
# Modified actual_fpts calculation with 1.5x multiplier for first player
|
221 |
+
working_df['actual_fpts'] = working_df.apply(
|
222 |
+
lambda row: (st.session_state['actual_dict'].get(row[2], 0) * 1.5) +
|
223 |
+
sum(st.session_state['actual_dict'].get(player, 0) for player in row[3:]),
|
224 |
+
axis=1
|
225 |
+
)
|
226 |
working_df['actual_own'] = working_df.apply(lambda row: sum(st.session_state['ownership_dict'].get(player, 0) for player in row), axis=1)
|
227 |
working_df['sorted'] = working_df[player_columns].apply(
|
228 |
lambda row: ','.join(sorted(row.values)),
|