James McCool
commited on
Commit
·
8ea397a
1
Parent(s):
a0d4812
Remove debug print statements and refine player data retrieval logic in 'exposure_spread' function to improve clarity and maintainability.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -255,9 +255,6 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
|
|
| 255 |
|
| 256 |
# Filter out players that are already present in this row
|
| 257 |
existing_players = set(current_row_data.values)
|
| 258 |
-
print(existing_players)
|
| 259 |
-
print(comparable_players)
|
| 260 |
-
print("^^^^ comparable players")
|
| 261 |
try:
|
| 262 |
comparable_players = comparable_players[~comparable_players['player_names'].isin(existing_players)]
|
| 263 |
comparable_player_list = comparable_players['player_names'].tolist()
|
|
@@ -321,8 +318,14 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
|
|
| 321 |
comparable_player_list = comparable_players['player_names'].tolist()
|
| 322 |
if comparable_player_list:
|
| 323 |
# Find which column contains the exposure_player
|
| 324 |
-
|
| 325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
if row_data[col] in comparable_player_list:
|
| 327 |
if working_frame.iloc[row]['salary'] - projections_df[projections_df['player_names'] == row_data[col]]['salary'].iloc[0] + projections_df[projections_df['player_names'] == exposure_player]['salary'].iloc[0] <= salary_max:
|
| 328 |
if type_var == 'Classic':
|
|
|
|
| 255 |
|
| 256 |
# Filter out players that are already present in this row
|
| 257 |
existing_players = set(current_row_data.values)
|
|
|
|
|
|
|
|
|
|
| 258 |
try:
|
| 259 |
comparable_players = comparable_players[~comparable_players['player_names'].isin(existing_players)]
|
| 260 |
comparable_player_list = comparable_players['player_names'].tolist()
|
|
|
|
| 318 |
comparable_player_list = comparable_players['player_names'].tolist()
|
| 319 |
if comparable_player_list:
|
| 320 |
# Find which column contains the exposure_player
|
| 321 |
+
if specific_columns != []:
|
| 322 |
+
row_data = working_frame.iloc[row][specific_columns]
|
| 323 |
+
working_columns = specific_columns
|
| 324 |
+
else:
|
| 325 |
+
row_data = working_frame.iloc[row]
|
| 326 |
+
working_columns = working_frame.columns
|
| 327 |
+
|
| 328 |
+
for col in working_columns:
|
| 329 |
if row_data[col] in comparable_player_list:
|
| 330 |
if working_frame.iloc[row]['salary'] - projections_df[projections_df['player_names'] == row_data[col]]['salary'].iloc[0] + projections_df[projections_df['player_names'] == exposure_player]['salary'].iloc[0] <= salary_max:
|
| 331 |
if type_var == 'Classic':
|