James McCool
commited on
Commit
·
5a9b212
1
Parent(s):
ec805d9
Refactor player ID mapping in grab_contest_data.py for improved data handling
Browse files- Updated the player ID mapping to use the original data type instead of converting to string, enhancing data integrity and consistency in player identification.
- This change contributes to ongoing efforts to streamline data processing functions and improve overall code maintainability.
global_func/grab_contest_data.py
CHANGED
@@ -46,7 +46,7 @@ def grab_contest_data(sport, contest_name, contest_id_map, contest_date_map):
|
|
46 |
players_df = pd.DataFrame(player_data)
|
47 |
players_df = players_df.sort_values(by='ownership', ascending=False).reset_index(drop=True)
|
48 |
players_df = players_df.rename(columns={'fullName': 'Player', 'rosterPosition': 'Roster Position', 'ownership': '%Drafted', 'actualPoints': 'FPTS'})
|
49 |
-
pid_map = dict(zip(players_df['playerId']
|
50 |
|
51 |
for lineup_hash, lineup_info in lineups_json['lineups'].items():
|
52 |
lineup_data.append({
|
|
|
46 |
players_df = pd.DataFrame(player_data)
|
47 |
players_df = players_df.sort_values(by='ownership', ascending=False).reset_index(drop=True)
|
48 |
players_df = players_df.rename(columns={'fullName': 'Player', 'rosterPosition': 'Roster Position', 'ownership': '%Drafted', 'actualPoints': 'FPTS'})
|
49 |
+
pid_map = dict(zip(players_df['playerId'], players_df['Player']))
|
50 |
|
51 |
for lineup_hash, lineup_info in lineups_json['lineups'].items():
|
52 |
lineup_data.append({
|