James McCool
commited on
Commit
·
c8c72a5
1
Parent(s):
1277f48
Refactor data type handling in grab_contest_data.py for improved clarity
Browse files- Updated the data type conversion in the lineups DataFrame to apply specifically to columns defined in position_inserts, enhancing clarity and maintainability.
- This change aligns with ongoing efforts to streamline data processing and ensure data integrity.
global_func/grab_contest_data.py
CHANGED
@@ -65,8 +65,8 @@ def grab_contest_data(sport, contest_name, contest_id_map, contest_date_map):
|
|
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 |
-
for
|
69 |
-
lineups_df[
|
70 |
lineups_df['Lineup'] = lineups_df['Lineup'].replace(pid_map, regex=True)
|
71 |
lineups_df = lineups_df[['Rank', 'EntryId', 'EntryName', 'TimeRemaining', 'Points', 'Lineup']]
|
72 |
|
|
|
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 |
+
for pos_col in position_inserts:
|
69 |
+
lineups_df[pos_col] = lineups_df[pos_col].astype(int)
|
70 |
lineups_df['Lineup'] = lineups_df['Lineup'].replace(pid_map, regex=True)
|
71 |
lineups_df = lineups_df[['Rank', 'EntryId', 'EntryName', 'TimeRemaining', 'Points', 'Lineup']]
|
72 |
|