Spaces:
Running
Running
James McCool
commited on
Commit
·
4f7c6f3
1
Parent(s):
1d52481
Update app.py to include 'FLEX5' in player selection for various slate types. This change enhances the data structure for player lineups, ensuring compatibility with expanded player options in the application.
Browse files
app.py
CHANGED
@@ -296,19 +296,19 @@ def init_FD_lineups(type_var,slate_var):
|
|
296 |
cursor = collection.find().limit(10000)
|
297 |
|
298 |
raw_display = pd.DataFrame(list(cursor))
|
299 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
300 |
elif slate_var == 'Secondary':
|
301 |
collection = db['FD_MLB_SD2_seed_frame']
|
302 |
cursor = collection.find().limit(10000)
|
303 |
|
304 |
raw_display = pd.DataFrame(list(cursor))
|
305 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
306 |
elif slate_var == 'Auxiliary':
|
307 |
collection = db['FD_MLB_SD3_seed_frame']
|
308 |
cursor = collection.find().limit(10000)
|
309 |
|
310 |
raw_display = pd.DataFrame(list(cursor))
|
311 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
312 |
|
313 |
FD_seed = raw_display.to_numpy()
|
314 |
|
@@ -676,7 +676,7 @@ with tab3:
|
|
676 |
if slate_type_var3 == 'Regular':
|
677 |
map_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']
|
678 |
elif slate_type_var3 == 'Showdown':
|
679 |
-
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4']
|
680 |
for col_idx in map_columns:
|
681 |
export_file[col_idx] = export_file[col_idx].map(fd_id_map)
|
682 |
|
@@ -776,7 +776,7 @@ with tab3:
|
|
776 |
if slate_type_var3 == 'Regular':
|
777 |
player_columns = st.session_state.data_export_display.iloc[:, :9]
|
778 |
elif slate_type_var3 == 'Showdown':
|
779 |
-
player_columns = st.session_state.data_export_display.iloc[:, :
|
780 |
|
781 |
# Flatten the DataFrame and count unique values
|
782 |
value_counts = player_columns.values.flatten().tolist()
|
@@ -818,7 +818,7 @@ with tab3:
|
|
818 |
if slate_type_var3 == 'Regular':
|
819 |
player_columns = st.session_state.working_seed[:, :9]
|
820 |
elif slate_type_var3 == 'Showdown':
|
821 |
-
player_columns = st.session_state.working_seed[:, :
|
822 |
|
823 |
# Flatten the DataFrame and count unique values
|
824 |
value_counts = player_columns.flatten().tolist()
|
|
|
296 |
cursor = collection.find().limit(10000)
|
297 |
|
298 |
raw_display = pd.DataFrame(list(cursor))
|
299 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
300 |
elif slate_var == 'Secondary':
|
301 |
collection = db['FD_MLB_SD2_seed_frame']
|
302 |
cursor = collection.find().limit(10000)
|
303 |
|
304 |
raw_display = pd.DataFrame(list(cursor))
|
305 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
306 |
elif slate_var == 'Auxiliary':
|
307 |
collection = db['FD_MLB_SD3_seed_frame']
|
308 |
cursor = collection.find().limit(10000)
|
309 |
|
310 |
raw_display = pd.DataFrame(list(cursor))
|
311 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
312 |
|
313 |
FD_seed = raw_display.to_numpy()
|
314 |
|
|
|
676 |
if slate_type_var3 == 'Regular':
|
677 |
map_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']
|
678 |
elif slate_type_var3 == 'Showdown':
|
679 |
+
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5']
|
680 |
for col_idx in map_columns:
|
681 |
export_file[col_idx] = export_file[col_idx].map(fd_id_map)
|
682 |
|
|
|
776 |
if slate_type_var3 == 'Regular':
|
777 |
player_columns = st.session_state.data_export_display.iloc[:, :9]
|
778 |
elif slate_type_var3 == 'Showdown':
|
779 |
+
player_columns = st.session_state.data_export_display.iloc[:, :6]
|
780 |
|
781 |
# Flatten the DataFrame and count unique values
|
782 |
value_counts = player_columns.values.flatten().tolist()
|
|
|
818 |
if slate_type_var3 == 'Regular':
|
819 |
player_columns = st.session_state.working_seed[:, :9]
|
820 |
elif slate_type_var3 == 'Showdown':
|
821 |
+
player_columns = st.session_state.working_seed[:, :7]
|
822 |
|
823 |
# Flatten the DataFrame and count unique values
|
824 |
value_counts = player_columns.flatten().tolist()
|