James McCool commited on
Commit
978080b
·
1 Parent(s): 245a9b5

Update lineup splitting to include 'Remove' column in load_contest_file function

Browse files

- Modified the lineup splitting logic to add a 'Remove' column, enhancing the organization of player data in the cleaned dataframe.
- This change continues the effort to refine data handling and improve user experience within the application.

Files changed (1) hide show
  1. global_func/load_contest_file.py +1 -1
global_func/load_contest_file.py CHANGED
@@ -42,7 +42,7 @@ def load_contest_file(upload, sport):
42
  # Create the cleaned dataframe with just the essential columns
43
  cleaned_df = df[['BaseName', 'EntryCount', 'Lineup']]
44
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace(pos_list, value=',', regex=True)
45
- cleaned_df[['1B', '2B', '3B', 'C', 'OF1', 'OF2', 'OF3', 'P1', 'P2', 'SS']] = cleaned_df['Lineup'].str.split(',', expand=True)
46
 
47
  # Get unique entry names
48
  entry_list = list(set(df['BaseName']))
 
42
  # Create the cleaned dataframe with just the essential columns
43
  cleaned_df = df[['BaseName', 'EntryCount', 'Lineup']]
44
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace(pos_list, value=',', regex=True)
45
+ cleaned_df[['Remove', '1B', '2B', '3B', 'C', 'OF1', 'OF2', 'OF3', 'P1', 'P2', 'SS']] = cleaned_df['Lineup'].str.split(',', expand=True)
46
 
47
  # Get unique entry names
48
  entry_list = list(set(df['BaseName']))