James McCool
commited on
Commit
·
6e4997c
1
Parent(s):
0b97fc2
Enhance WNBA lineup parsing in load_contest_file.py
Browse files- Updated the regex replacement for WNBA lineups to include additional player position variations, ensuring more accurate formatting and data integrity during parsing.
- This change improves the handling of player positions, contributing to better overall data quality for WNBA contests.
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(['F ', ' UTIL ', ' G '], value=',', regex=True)
|
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 ', ' F ', 'G '], value=',', regex=True)
|
118 |
print(sport)
|
119 |
check_lineups = cleaned_df.copy()
|
120 |
if sport == 'MLB':
|