James McCool commited on
Commit
b2664c1
·
1 Parent(s): 2b6c4f2

Refactor team data retrieval in init_player_data function to filter by 'position' instead of 'teamname'. This change improves data accuracy for team statistics calculations, enhancing the integrity of player performance metrics during simulations.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -413,8 +413,8 @@ def init_player_data(game_count, players, opponent, win_loss_settings, kill_pred
413
  for stats in calc_columns:
414
  playername_win_stats[stats] = tables[tables['result'] == 1].groupby(['playername'])[stats].mean().to_dict()
415
  playername_loss_stats[stats] = tables[tables['result'] == 0].groupby(['playername'])[stats].mean().to_dict()
416
- teamname_win_stats[stats] = tables[(tables['result'] == 1) & (tables['teamname'] == 'team')].groupby(['teamname'])[stats].mean().to_dict()
417
- teamname_loss_stats[stats] = tables[(tables['result'] == 0) & (tables['teamname'] == 'team')].groupby(['teamname'])[stats].mean().to_dict()
418
 
419
  for stat in calc_columns:
420
 
 
413
  for stats in calc_columns:
414
  playername_win_stats[stats] = tables[tables['result'] == 1].groupby(['playername'])[stats].mean().to_dict()
415
  playername_loss_stats[stats] = tables[tables['result'] == 0].groupby(['playername'])[stats].mean().to_dict()
416
+ teamname_win_stats[stats] = tables[(tables['result'] == 1) & (tables['position'] == 'team')].groupby(['teamname'])[stats].mean().to_dict()
417
+ teamname_loss_stats[stats] = tables[(tables['result'] == 0) & (tables['position'] == 'team')].groupby(['teamname'])[stats].mean().to_dict()
418
 
419
  for stat in calc_columns:
420