James McCool commited on
Commit
637112e
·
1 Parent(s): 56ac316

Refine column selection in load_contest_file function for improved data structure

Browse files

- Updated the cleaned dataframe to explicitly select and reorder essential columns after processing, enhancing data organization and accessibility.
- This change continues the effort to streamline data handling and improve user experience within the application.

Files changed (1) hide show
  1. global_func/load_contest_file.py +1 -0
global_func/load_contest_file.py CHANGED
@@ -44,6 +44,7 @@ def load_contest_file(upload, sport):
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
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
 
47
 
48
  # Get unique entry names
49
  entry_list = list(set(df['BaseName']))
 
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
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
47
+ cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'P1', 'P2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3']]
48
 
49
  # Get unique entry names
50
  entry_list = list(set(df['BaseName']))