James McCool
commited on
Commit
·
e076a1d
1
Parent(s):
f051d8d
intro CFB into sport options
Browse files- app.py +1 -1
- global_func/load_contest_file.py +6 -0
app.py
CHANGED
|
@@ -185,7 +185,7 @@ if selected_tab == 'Data Load':
|
|
| 185 |
sport_options, date_options = st.columns(2)
|
| 186 |
parse_type = 'Manual'
|
| 187 |
with sport_options:
|
| 188 |
-
sport_init = st.selectbox("Select Sport", ['MLB', 'MMA', 'GOLF', 'NBA', 'NHL', 'WNBA', 'NAS'], key='sport_init')
|
| 189 |
type_init = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_init')
|
| 190 |
try:
|
| 191 |
contest_names, curr_info = grab_contest_names(db, sport_init, type_init)
|
|
|
|
| 185 |
sport_options, date_options = st.columns(2)
|
| 186 |
parse_type = 'Manual'
|
| 187 |
with sport_options:
|
| 188 |
+
sport_init = st.selectbox("Select Sport", ['MLB', 'MMA', 'GOLF', 'NBA', 'NHL', 'CFB', 'WNBA', 'NAS'], key='sport_init')
|
| 189 |
type_init = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_init')
|
| 190 |
try:
|
| 191 |
contest_names, curr_info = grab_contest_names(db, sport_init, type_init)
|
global_func/load_contest_file.py
CHANGED
|
@@ -119,6 +119,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
|
|
| 119 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'F ', ' F ', ' UTIL '], value=',', regex=True)
|
| 120 |
elif sport == 'NAS':
|
| 121 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
|
|
|
|
|
|
|
| 122 |
print(sport)
|
| 123 |
check_lineups = cleaned_df.copy()
|
| 124 |
if sport == 'MLB':
|
|
@@ -131,6 +133,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
|
|
| 131 |
cleaned_df[['Remove', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
| 132 |
elif sport == 'NAS':
|
| 133 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
|
|
|
|
|
|
| 134 |
cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
|
| 135 |
entry_counts = cleaned_df['BaseName'].value_counts()
|
| 136 |
cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)
|
|
@@ -144,6 +148,8 @@ def load_contest_file(upload, type, helper = None, sport = None, portfolio = Non
|
|
| 144 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']]
|
| 145 |
elif sport == 'NAS':
|
| 146 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
|
|
|
|
|
|
| 147 |
elif type == 'Showdown':
|
| 148 |
if sport == 'NHL':
|
| 149 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' FLEX ', 'CPT '], value=',', regex=True)
|
|
|
|
| 119 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' G ', 'F ', ' F ', ' UTIL '], value=',', regex=True)
|
| 120 |
elif sport == 'NAS':
|
| 121 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' D ', 'D '], value=',', regex=True)
|
| 122 |
+
elif sport == 'CFB':
|
| 123 |
+
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' QB ', 'QB ', ' RB ', 'RB ', 'WR ', 'WR ', ' FLEX ', 'FLEX ', ' S-FLEX ', 'S-FLEX '], value=',', regex=True)
|
| 124 |
print(sport)
|
| 125 |
check_lineups = cleaned_df.copy()
|
| 126 |
if sport == 'MLB':
|
|
|
|
| 133 |
cleaned_df[['Remove', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
| 134 |
elif sport == 'NAS':
|
| 135 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
| 136 |
+
elif sport == 'CFB':
|
| 137 |
+
cleaned_df[['Remove', 'QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'FLEX', 'S-FLEX']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
| 138 |
cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
|
| 139 |
entry_counts = cleaned_df['BaseName'].value_counts()
|
| 140 |
cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)
|
|
|
|
| 148 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'G1', 'G2', 'F1', 'F2', 'F3', 'UTIL']]
|
| 149 |
elif sport == 'NAS':
|
| 150 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
| 151 |
+
elif sport == 'CFB':
|
| 152 |
+
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'FLEX', 'S-FLEX']]
|
| 153 |
elif type == 'Showdown':
|
| 154 |
if sport == 'NHL':
|
| 155 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' FLEX ', 'CPT '], value=',', regex=True)
|