James McCool commited on
Commit
4e5f9a7
·
1 Parent(s): 268badd

Refactor player location retrieval in exposure_spread function to use list index method, improving clarity and ensuring accurate player replacement from the comparable player list.

Browse files
Files changed (1) hide show
  1. global_func/exposure_spread.py +1 -1
global_func/exposure_spread.py CHANGED
@@ -40,7 +40,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
40
 
41
  # for each row to the the number of lineups to remove, replace with random choice from comparable player list
42
  for row in range(math.ceil(lineups_to_remove)):
43
- player_location = player_rows.columns.get_loc(exposure_player)
44
  working_frame.iloc[row, player_location] = random.choice(comparable_player_list)
45
 
46
  return working_frame
 
40
 
41
  # for each row to the the number of lineups to remove, replace with random choice from comparable player list
42
  for row in range(math.ceil(lineups_to_remove)):
43
+ player_location = list(player_rows.iloc[row]).index(exposure_player)
44
  working_frame.iloc[row, player_location] = random.choice(comparable_player_list)
45
 
46
  return working_frame