James McCool commited on
Commit
8d09918
·
1 Parent(s): 5b2d759

Update WNBA lineup parsing in load_contest_file.py

Browse files

- Added 'Remove' column to the DataFrame for WNBA lineups, ensuring accurate parsing of player positions.
- Enhanced the data cleaning process by dropping unnecessary columns after splitting the lineup, improving overall data integrity.

Files changed (1) hide show
  1. global_func/load_contest_file.py +1 -1
global_func/load_contest_file.py CHANGED
@@ -124,7 +124,7 @@ def load_contest_file(upload, type, helper = None, sport = None):
124
  elif sport == 'GOLF':
125
  cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
126
  elif sport == 'WNBA':
127
- cleaned_df[['Guard1', 'Guard2', 'Forward1', 'Forward2', 'Forward3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
128
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
129
  entry_counts = cleaned_df['BaseName'].value_counts()
130
  cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)
 
124
  elif sport == 'GOLF':
125
  cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
126
  elif sport == 'WNBA':
127
+ cleaned_df[['Remove', 'Guard1', 'Guard2', 'Forward1', 'Forward2', 'Forward3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
128
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
129
  entry_counts = cleaned_df['BaseName'].value_counts()
130
  cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)