James McCool commited on
Commit
ce11442
·
1 Parent(s): 34b8899

Fix game number indexing in player summary generation to support data type selection. Updated logic to correctly reference game numbers based on the selected data type ("Team" or "Player"), ensuring accurate retrieval of player statistics. This change enhances data integrity and improves the clarity of player summaries during simulations.

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -598,7 +598,10 @@ if st.button("Run"):
598
 
599
  player_summary = pd.DataFrame()
600
  for game_num in range(game_count):
601
- game_df = results_dict[f'game {game_num + 1}'] # Use correct dictionary key format
 
 
 
602
  # Remove 'game X' from playernames if present
603
  clean_df = game_df.copy()
604
  clean_df['playername'] = clean_df['playername'].str.split(' game ').str[0]
 
598
 
599
  player_summary = pd.DataFrame()
600
  for game_num in range(game_count):
601
+ if data_type == "Team":
602
+ game_df = results_dict[f'game {game_num + 1}'] # Use correct dictionary key format
603
+ else:
604
+ game_df = results_dict[f'game {game_num}'] # Use correct dictionary key format
605
  # Remove 'game X' from playernames if present
606
  clean_df = game_df.copy()
607
  clean_df['playername'] = clean_df['playername'].str.split(' game ').str[0]