James McCool commited on
Commit
87b0cd7
·
1 Parent(s): 70aed03

Fixing position designations for tennis

Browse files
Files changed (1) hide show
  1. global_func/load_contest_file.py +8 -0
global_func/load_contest_file.py CHANGED
@@ -127,6 +127,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
127
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'F ', ' F ', ' UTIL '], value=',', regex=True)
128
  elif sport == 'NAS':
129
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
 
 
130
  elif sport == 'CFB':
131
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' QB ', 'QB ', ' RB ', 'RB ', 'WR ', 'WR ', ' S-FLEX ', 'S-FLEX ', ' FLEX ', 'FLEX '], value=',', regex=True)
132
  print(sport)
@@ -147,6 +149,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
147
  cleaned_df[['Remove', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
148
  elif sport == 'NAS':
149
  cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
 
 
150
  elif sport == 'CFB':
151
  cleaned_df[['Remove', 'FLEX', 'QB', 'RB1', 'RB2', 'S-FLEX', 'WR1', 'WR2', 'WR3']] = cleaned_df['Lineup'].str.split(',', expand=True)
152
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
@@ -168,6 +172,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
168
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']]
169
  elif sport == 'NAS':
170
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
 
 
171
  elif sport == 'CFB':
172
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'FLEX', 'S-FLEX']]
173
  elif type == 'Showdown':
@@ -181,6 +187,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
181
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'G '], value=',', regex=True)
182
  elif sport == 'NAS':
183
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
 
 
184
  else:
185
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' UTIL ', 'CPT '], value=',', regex=True)
186
  print(type)
 
127
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'F ', ' F ', ' UTIL '], value=',', regex=True)
128
  elif sport == 'NAS':
129
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
130
+ elif sport == 'TEN':
131
+ cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', 'P '], value=',', regex=True)
132
  elif sport == 'CFB':
133
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' QB ', 'QB ', ' RB ', 'RB ', 'WR ', 'WR ', ' S-FLEX ', 'S-FLEX ', ' FLEX ', 'FLEX '], value=',', regex=True)
134
  print(sport)
 
149
  cleaned_df[['Remove', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
150
  elif sport == 'NAS':
151
  cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
152
+ elif sport == 'TEN':
153
+ cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
154
  elif sport == 'CFB':
155
  cleaned_df[['Remove', 'FLEX', 'QB', 'RB1', 'RB2', 'S-FLEX', 'WR1', 'WR2', 'WR3']] = cleaned_df['Lineup'].str.split(',', expand=True)
156
  cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
 
172
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']]
173
  elif sport == 'NAS':
174
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
175
+ elif sport == 'TEN':
176
+ cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
177
  elif sport == 'CFB':
178
  cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'FLEX', 'S-FLEX']]
179
  elif type == 'Showdown':
 
187
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'G '], value=',', regex=True)
188
  elif sport == 'NAS':
189
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
190
+ elif sport == 'TEN':
191
+ cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', 'P '], value=',', regex=True)
192
  else:
193
  cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' UTIL ', 'CPT '], value=',', regex=True)
194
  print(type)