James McCool
commited on
Commit
·
401a7dd
1
Parent(s):
8d09918
Fix WNBA lineup parsing in load_contest_file.py
Browse files- Adjusted the regex replacement for WNBA lineups to ensure proper formatting of player positions by removing unnecessary spaces, enhancing data accuracy during parsing.
global_func/load_contest_file.py
CHANGED
@@ -114,7 +114,7 @@ def load_contest_file(upload, type, helper = None, sport = None):
|
|
114 |
elif sport == 'GOLF':
|
115 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', ' C ', '1B ', ' 2B ', ' 3B ', ' SS ', ' OF ', ' G ', 'G '], value=',', regex=True)
|
116 |
elif sport == 'WNBA':
|
117 |
-
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace(['
|
118 |
print(sport)
|
119 |
check_lineups = cleaned_df.copy()
|
120 |
if sport == 'MLB':
|
|
|
114 |
elif sport == 'GOLF':
|
115 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', ' C ', '1B ', ' 2B ', ' 3B ', ' SS ', ' OF ', ' G ', 'G '], value=',', regex=True)
|
116 |
elif sport == 'WNBA':
|
117 |
+
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace(['F ', ' UTIL ', ' G '], value=',', regex=True)
|
118 |
print(sport)
|
119 |
check_lineups = cleaned_df.copy()
|
120 |
if sport == 'MLB':
|