James McCool commited on
Commit
a8cfbf7
·
1 Parent(s): a37d3b8

Update grab_contest_data function to include entry name suffix and adjust DataFrame structure

Browse files

- Added a suffix to the 'EntryName' column to indicate the entry count, enhancing clarity for users.
- Modified the DataFrame structure to exclude 'EntryId', streamlining the output for better readability.

Files changed (1) hide show
  1. global_func/grab_contest_data.py +2 -1
global_func/grab_contest_data.py CHANGED
@@ -63,9 +63,10 @@ def grab_contest_data(sport, contest_name, contest_id_map, contest_date_map):
63
  lineups_df['EntryId'] = lineups_df['lineupHash'].astype(str) + str(lineups_df['index']) + str(lineups_df['entryNameList'])
64
  lineups_df['lineupHash'] = ':' + lineups_df['lineupHash']
65
  lineups_df = lineups_df.rename(columns={'index': 'Rank', 'points': 'Points', 'entryNameList': 'EntryName', 'lineupHash': 'Lineup'})
 
66
  lineups_df['Lineup'] = lineups_df['Lineup'].apply(lambda x: format_lineup_string(x, position_inserts))
67
  lineups_df['Lineup'] = lineups_df['Lineup'].replace(pid_map, regex=True)
68
- lineups_df = lineups_df[['Rank', 'EntryId', 'EntryName', 'TimeRemaining', 'Points', 'Lineup']]
69
 
70
  total_data = lineups_df.merge(players_df, how='left', left_index=True, right_index=True)
71
 
 
63
  lineups_df['EntryId'] = lineups_df['lineupHash'].astype(str) + str(lineups_df['index']) + str(lineups_df['entryNameList'])
64
  lineups_df['lineupHash'] = ':' + lineups_df['lineupHash']
65
  lineups_df = lineups_df.rename(columns={'index': 'Rank', 'points': 'Points', 'entryNameList': 'EntryName', 'lineupHash': 'Lineup'})
66
+ lineups_df['EntryName'] = lineups_df['EntryName'] + ' (1/1)'
67
  lineups_df['Lineup'] = lineups_df['Lineup'].apply(lambda x: format_lineup_string(x, position_inserts))
68
  lineups_df['Lineup'] = lineups_df['Lineup'].replace(pid_map, regex=True)
69
+ lineups_df = lineups_df[['Rank', 'EntryName', 'TimeRemaining', 'Points', 'Lineup']]
70
 
71
  total_data = lineups_df.merge(players_df, how='left', left_index=True, right_index=True)
72