James McCool
commited on
Commit
·
f4f6da8
1
Parent(s):
41b98e8
Refactor salary and projection calculations in 'exposure_spread' function to apply conditional logic based on 'type_var', improving accuracy for Showdown scenarios.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -153,9 +153,15 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
|
|
| 153 |
|
| 154 |
comparable_players = comparable_players.reset_index(drop=True)
|
| 155 |
comp_salary_high = comparable_players['salary'][0]
|
| 156 |
-
|
|
|
|
|
|
|
|
|
|
| 157 |
comp_projection_high = comparable_players['median'][0]
|
| 158 |
-
|
|
|
|
|
|
|
|
|
|
| 159 |
# players can be eligible at multiple positions, so we need to find all the positions the player is eligible at
|
| 160 |
# the position column can have positions designated as 1B/OF which means they are eligible at 1B and OF
|
| 161 |
comp_player_position = comparable_players['position'].tolist()
|
|
|
|
| 153 |
|
| 154 |
comparable_players = comparable_players.reset_index(drop=True)
|
| 155 |
comp_salary_high = comparable_players['salary'][0]
|
| 156 |
+
if type_var == 'Showdown':
|
| 157 |
+
comp_salary_low = comparable_players['salary'][0] - 1000
|
| 158 |
+
else:
|
| 159 |
+
comp_salary_low = comparable_players['salary'][0] - 500
|
| 160 |
comp_projection_high = comparable_players['median'][0]
|
| 161 |
+
if type_var == 'Showdown':
|
| 162 |
+
comp_projection_low = comparable_players['median'][0] - (comparable_players['median'][0] * .5)
|
| 163 |
+
else:
|
| 164 |
+
comp_projection_low = comparable_players['median'][0] - (comparable_players['median'][0] * .75)
|
| 165 |
# players can be eligible at multiple positions, so we need to find all the positions the player is eligible at
|
| 166 |
# the position column can have positions designated as 1B/OF which means they are eligible at 1B and OF
|
| 167 |
comp_player_position = comparable_players['position'].tolist()
|