Jimin Park commited on
Commit
e9fb72e
·
1 Parent(s): 67e33fc

kermitting soon

Browse files
Files changed (1) hide show
  1. util/helper.py +6 -1
util/helper.py CHANGED
@@ -955,14 +955,19 @@ def calculate_champion_loyalty(df):
955
  # print("row['L_1'] type: ", type(row['L_1']), "\n row['L_1']: ", row['L_1'], "\n")
956
  print(f"row['W_1'] value: {repr(row['W_1'])}, type: {type(row['W_1'])}")
957
  print(f"row['L_1'] value: {repr(row['L_1'])}, type: {type(row['L_1'])}")
958
-
 
 
959
  recent_games = [
960
  (int(row['W_1']) + int(row['L_1'])) if pd.notna(row['most_champ_1']) else 0,
961
  (int(row['W_2']) + int(row['L_2'])) if pd.notna(row['most_champ_2']) else 0
962
  ]
 
963
 
 
964
  total_recent_games = sum(recent_games)
965
  total_season_games = sum(season_games)
 
966
 
967
  if total_recent_games == 0:
968
  return {
 
955
  # print("row['L_1'] type: ", type(row['L_1']), "\n row['L_1']: ", row['L_1'], "\n")
956
  print(f"row['W_1'] value: {repr(row['W_1'])}, type: {type(row['W_1'])}")
957
  print(f"row['L_1'] value: {repr(row['L_1'])}, type: {type(row['L_1'])}")
958
+
959
+ print(".... END calculate games played for recent champions (only top 2)\n")
960
+
961
  recent_games = [
962
  (int(row['W_1']) + int(row['L_1'])) if pd.notna(row['most_champ_1']) else 0,
963
  (int(row['W_2']) + int(row['L_2'])) if pd.notna(row['most_champ_2']) else 0
964
  ]
965
+ print(f"recent_games was: {recent_games}, types: {[type(x) for x in recent_games]}")
966
 
967
+ print("Summing recent games... \n")
968
  total_recent_games = sum(recent_games)
969
  total_season_games = sum(season_games)
970
+ print("End of summing recent games... \n Total recent_games = ", total_recent_games, "\n total_season_games: ", total_season_games, "\n")
971
 
972
  if total_recent_games == 0:
973
  return {