Spaces:
Running
Running
James McCool
commited on
Commit
·
4429236
1
Parent(s):
68cf021
Refactor database connection to remove unused secondary database and streamline data retrieval for Draftkings and Fanduel. Update column selections for showdown formats and enhance summary statistics display based on slate type.
Browse files
app.py
CHANGED
@@ -11,11 +11,10 @@ def init_conn():
|
|
11 |
uri = st.secrets['mongo_uri']
|
12 |
client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000)
|
13 |
db = client["MLB_Database"]
|
14 |
-
db2 = client["MLB_DFS"]
|
15 |
|
16 |
-
return db
|
17 |
|
18 |
-
db
|
19 |
|
20 |
game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}', 'Top Score': '{:.2%}',
|
21 |
'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
|
@@ -25,6 +24,8 @@ player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_fi
|
|
25 |
|
26 |
dk_columns = ['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
27 |
fd_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
|
|
|
|
28 |
|
29 |
@st.cache_resource(ttl = 60)
|
30 |
def init_baselines():
|
@@ -107,23 +108,23 @@ def init_DK_lineups(type_var, slate_var):
|
|
107 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
108 |
elif type_var == 'Showdown':
|
109 |
if slate_var == 'Main':
|
110 |
-
collection =
|
111 |
cursor = collection.find().limit(10000)
|
112 |
|
113 |
raw_display = pd.DataFrame(list(cursor))
|
114 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Own']]
|
115 |
elif slate_var == 'Secondary':
|
116 |
-
collection =
|
117 |
cursor = collection.find().limit(10000)
|
118 |
|
119 |
raw_display = pd.DataFrame(list(cursor))
|
120 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Own']]
|
121 |
elif slate_var == 'Auxiliary':
|
122 |
-
collection =
|
123 |
cursor = collection.find().limit(10000)
|
124 |
|
125 |
raw_display = pd.DataFrame(list(cursor))
|
126 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Own']]
|
127 |
|
128 |
DK_seed = raw_display.to_numpy()
|
129 |
|
@@ -178,23 +179,23 @@ def init_FD_lineups(type_var,slate_var):
|
|
178 |
|
179 |
elif type_var == 'Showdown':
|
180 |
if slate_var == 'Main':
|
181 |
-
collection =
|
182 |
cursor = collection.find().limit(10000)
|
183 |
|
184 |
raw_display = pd.DataFrame(list(cursor))
|
185 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Own']]
|
186 |
elif slate_var == 'Secondary':
|
187 |
-
collection =
|
188 |
cursor = collection.find().limit(10000)
|
189 |
|
190 |
raw_display = pd.DataFrame(list(cursor))
|
191 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Own']]
|
192 |
elif slate_var == 'Auxiliary':
|
193 |
-
collection =
|
194 |
cursor = collection.find().limit(10000)
|
195 |
|
196 |
raw_display = pd.DataFrame(list(cursor))
|
197 |
-
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Own']]
|
198 |
|
199 |
FD_seed = raw_display.to_numpy()
|
200 |
|
@@ -372,7 +373,7 @@ with tab3:
|
|
372 |
lineup_num_var = st.number_input("How many lineups do you want to display?", min_value=1, max_value=1000, value=150, step=1)
|
373 |
|
374 |
if slate_type_var3 == 'Regular':
|
375 |
-
|
376 |
elif slate_type_var3 == 'Showdown':
|
377 |
raw_baselines = sd_roo_data
|
378 |
|
@@ -380,12 +381,14 @@ with tab3:
|
|
380 |
if slate_type_var3 == 'Regular':
|
381 |
ROO_slice = raw_baselines[raw_baselines['Site'] == 'Draftkings']
|
382 |
player_salaries = dict(zip(ROO_slice['Player'], ROO_slice['Salary']))
|
|
|
383 |
elif slate_type_var3 == 'Showdown':
|
384 |
player_salaries = dict(zip(raw_baselines['Player'], raw_baselines['Salary']))
|
|
|
385 |
# Get the minimum and maximum ownership values from dk_lineups
|
386 |
-
min_own = np.min(dk_lineups[:,
|
387 |
-
max_own = np.max(dk_lineups[:,
|
388 |
-
|
389 |
|
390 |
player_var1 = st.radio("Do you want a frame with specific Players?", ('Full Slate', 'Specific Players'), key='player_var1')
|
391 |
if player_var1 == 'Specific Players':
|
@@ -398,11 +401,14 @@ with tab3:
|
|
398 |
if slate_type_var3 == 'Regular':
|
399 |
ROO_slice = raw_baselines[raw_baselines['Site'] == 'Fanduel']
|
400 |
player_salaries = dict(zip(ROO_slice['Player'], ROO_slice['Salary']))
|
|
|
401 |
elif slate_type_var3 == 'Showdown':
|
402 |
player_salaries = dict(zip(raw_baselines['Player'], raw_baselines['Salary']))
|
403 |
-
|
404 |
-
|
405 |
-
|
|
|
|
|
406 |
|
407 |
player_var1 = st.radio("Do you want a frame with specific Players?", ('Full Slate', 'Specific Players'), key='player_var1')
|
408 |
if player_var1 == 'Specific Players':
|
@@ -414,11 +420,17 @@ with tab3:
|
|
414 |
name_export = pd.DataFrame(st.session_state.working_seed.copy(), columns=column_names)
|
415 |
data_export = pd.DataFrame(st.session_state.working_seed.copy(), columns=column_names)
|
416 |
if site_var == 'Draftkings':
|
417 |
-
|
|
|
|
|
|
|
418 |
for col_idx in map_columns:
|
419 |
data_export[col_idx] = data_export[col_idx].map(dk_id_map)
|
420 |
elif site_var == 'Fanduel':
|
421 |
-
|
|
|
|
|
|
|
422 |
for col_idx in map_columns:
|
423 |
data_export[col_idx] = data_export[col_idx].map(fd_id_map)
|
424 |
st.download_button(
|
@@ -471,11 +483,17 @@ with tab3:
|
|
471 |
export_file = st.session_state.data_export_display.copy()
|
472 |
name_export = st.session_state.data_export_display.copy()
|
473 |
if site_var == 'Draftkings':
|
474 |
-
|
|
|
|
|
|
|
475 |
for col_idx in map_columns:
|
476 |
export_file[col_idx] = export_file[col_idx].map(dk_id_map)
|
477 |
elif site_var == 'Fanduel':
|
478 |
-
|
|
|
|
|
|
|
479 |
for col_idx in map_columns:
|
480 |
export_file[col_idx] = export_file[col_idx].map(fd_id_map)
|
481 |
|
@@ -503,72 +521,79 @@ with tab3:
|
|
503 |
)
|
504 |
|
505 |
with st.container():
|
506 |
-
if '
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
|
|
563 |
|
564 |
with st.container():
|
565 |
tab1, tab2 = st.tabs(["Display Frequency", "Seed Frame Frequency"])
|
566 |
with tab1:
|
567 |
if 'data_export_display' in st.session_state:
|
568 |
if site_var == 'Draftkings':
|
569 |
-
|
|
|
|
|
|
|
570 |
elif site_var == 'Fanduel':
|
571 |
-
|
|
|
|
|
|
|
572 |
|
573 |
# Flatten the DataFrame and count unique values
|
574 |
value_counts = player_columns.values.flatten().tolist()
|
@@ -602,9 +627,15 @@ with tab3:
|
|
602 |
with tab2:
|
603 |
if 'working_seed' in st.session_state:
|
604 |
if site_var == 'Draftkings':
|
605 |
-
|
|
|
|
|
|
|
606 |
elif site_var == 'Fanduel':
|
607 |
-
|
|
|
|
|
|
|
608 |
|
609 |
# Flatten the DataFrame and count unique values
|
610 |
value_counts = player_columns.flatten().tolist()
|
|
|
11 |
uri = st.secrets['mongo_uri']
|
12 |
client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000)
|
13 |
db = client["MLB_Database"]
|
|
|
14 |
|
15 |
+
return db
|
16 |
|
17 |
+
db = init_conn()
|
18 |
|
19 |
game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}', 'Top Score': '{:.2%}',
|
20 |
'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
|
|
|
24 |
|
25 |
dk_columns = ['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
26 |
fd_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
27 |
+
dk_sd_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
28 |
+
fd_sd_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
29 |
|
30 |
@st.cache_resource(ttl = 60)
|
31 |
def init_baselines():
|
|
|
108 |
raw_display[dict_columns] = raw_display[dict_columns].apply(lambda x: x.map(names_dict))
|
109 |
elif type_var == 'Showdown':
|
110 |
if slate_var == 'Main':
|
111 |
+
collection = db['DK_MLB_SD1_seed_frame']
|
112 |
cursor = collection.find().limit(10000)
|
113 |
|
114 |
raw_display = pd.DataFrame(list(cursor))
|
115 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
116 |
elif slate_var == 'Secondary':
|
117 |
+
collection = db['DK_MLB_SD2_seed_frame']
|
118 |
cursor = collection.find().limit(10000)
|
119 |
|
120 |
raw_display = pd.DataFrame(list(cursor))
|
121 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
122 |
elif slate_var == 'Auxiliary':
|
123 |
+
collection = db['DK_MLB_SD3_seed_frame']
|
124 |
cursor = collection.find().limit(10000)
|
125 |
|
126 |
raw_display = pd.DataFrame(list(cursor))
|
127 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
128 |
|
129 |
DK_seed = raw_display.to_numpy()
|
130 |
|
|
|
179 |
|
180 |
elif type_var == 'Showdown':
|
181 |
if slate_var == 'Main':
|
182 |
+
collection = db['FD_MLB_SD1_seed_frame']
|
183 |
cursor = collection.find().limit(10000)
|
184 |
|
185 |
raw_display = pd.DataFrame(list(cursor))
|
186 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
187 |
elif slate_var == 'Secondary':
|
188 |
+
collection = db['FD_MLB_SD2_seed_frame']
|
189 |
cursor = collection.find().limit(10000)
|
190 |
|
191 |
raw_display = pd.DataFrame(list(cursor))
|
192 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
193 |
elif slate_var == 'Auxiliary':
|
194 |
+
collection = db['FD_MLB_SD3_seed_frame']
|
195 |
cursor = collection.find().limit(10000)
|
196 |
|
197 |
raw_display = pd.DataFrame(list(cursor))
|
198 |
+
raw_display = raw_display[['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
199 |
|
200 |
FD_seed = raw_display.to_numpy()
|
201 |
|
|
|
373 |
lineup_num_var = st.number_input("How many lineups do you want to display?", min_value=1, max_value=1000, value=150, step=1)
|
374 |
|
375 |
if slate_type_var3 == 'Regular':
|
376 |
+
raw_baselines = roo_data
|
377 |
elif slate_type_var3 == 'Showdown':
|
378 |
raw_baselines = sd_roo_data
|
379 |
|
|
|
381 |
if slate_type_var3 == 'Regular':
|
382 |
ROO_slice = raw_baselines[raw_baselines['Site'] == 'Draftkings']
|
383 |
player_salaries = dict(zip(ROO_slice['Player'], ROO_slice['Salary']))
|
384 |
+
column_names = dk_columns
|
385 |
elif slate_type_var3 == 'Showdown':
|
386 |
player_salaries = dict(zip(raw_baselines['Player'], raw_baselines['Salary']))
|
387 |
+
column_names = dk_sd_columns
|
388 |
# Get the minimum and maximum ownership values from dk_lineups
|
389 |
+
min_own = np.min(dk_lineups[:,12])
|
390 |
+
max_own = np.max(dk_lineups[:,12])
|
391 |
+
|
392 |
|
393 |
player_var1 = st.radio("Do you want a frame with specific Players?", ('Full Slate', 'Specific Players'), key='player_var1')
|
394 |
if player_var1 == 'Specific Players':
|
|
|
401 |
if slate_type_var3 == 'Regular':
|
402 |
ROO_slice = raw_baselines[raw_baselines['Site'] == 'Fanduel']
|
403 |
player_salaries = dict(zip(ROO_slice['Player'], ROO_slice['Salary']))
|
404 |
+
column_names = fd_columns
|
405 |
elif slate_type_var3 == 'Showdown':
|
406 |
player_salaries = dict(zip(raw_baselines['Player'], raw_baselines['Salary']))
|
407 |
+
column_names = fd_sd_columns
|
408 |
+
# Get the minimum and maximum ownership values from dk_lineups
|
409 |
+
min_own = np.min(fd_lineups[:,11])
|
410 |
+
max_own = np.max(fd_lineups[:,11])
|
411 |
+
|
412 |
|
413 |
player_var1 = st.radio("Do you want a frame with specific Players?", ('Full Slate', 'Specific Players'), key='player_var1')
|
414 |
if player_var1 == 'Specific Players':
|
|
|
420 |
name_export = pd.DataFrame(st.session_state.working_seed.copy(), columns=column_names)
|
421 |
data_export = pd.DataFrame(st.session_state.working_seed.copy(), columns=column_names)
|
422 |
if site_var == 'Draftkings':
|
423 |
+
if slate_type_var3 == 'Regular':
|
424 |
+
map_columns = ['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3']
|
425 |
+
elif slate_type_var3 == 'Showdown':
|
426 |
+
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5']
|
427 |
for col_idx in map_columns:
|
428 |
data_export[col_idx] = data_export[col_idx].map(dk_id_map)
|
429 |
elif site_var == 'Fanduel':
|
430 |
+
if slate_type_var3 == 'Regular':
|
431 |
+
map_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']
|
432 |
+
elif slate_type_var3 == 'Showdown':
|
433 |
+
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4']
|
434 |
for col_idx in map_columns:
|
435 |
data_export[col_idx] = data_export[col_idx].map(fd_id_map)
|
436 |
st.download_button(
|
|
|
483 |
export_file = st.session_state.data_export_display.copy()
|
484 |
name_export = st.session_state.data_export_display.copy()
|
485 |
if site_var == 'Draftkings':
|
486 |
+
if slate_type_var3 == 'Regular':
|
487 |
+
map_columns = ['SP1', 'SP2', 'C', '1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3']
|
488 |
+
elif slate_type_var3 == 'Showdown':
|
489 |
+
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4', 'FLEX5']
|
490 |
for col_idx in map_columns:
|
491 |
export_file[col_idx] = export_file[col_idx].map(dk_id_map)
|
492 |
elif site_var == 'Fanduel':
|
493 |
+
if slate_type_var3 == 'Regular':
|
494 |
+
map_columns = ['P', 'C_1B', '2B', '3B', 'SS', 'OF1', 'OF2', 'OF3', 'UTIL']
|
495 |
+
elif slate_type_var3 == 'Showdown':
|
496 |
+
map_columns = ['CPT', 'FLEX1', 'FLEX2', 'FLEX3', 'FLEX4']
|
497 |
for col_idx in map_columns:
|
498 |
export_file[col_idx] = export_file[col_idx].map(fd_id_map)
|
499 |
|
|
|
521 |
)
|
522 |
|
523 |
with st.container():
|
524 |
+
if slate_type_var3 == 'Regular':
|
525 |
+
if 'working_seed' in st.session_state:
|
526 |
+
# Create a new dataframe with summary statistics
|
527 |
+
if site_var == 'Draftkings':
|
528 |
+
summary_df = pd.DataFrame({
|
529 |
+
'Metric': ['Min', 'Average', 'Max', 'STDdev'],
|
530 |
+
'Salary': [
|
531 |
+
np.min(st.session_state.working_seed[:,10]),
|
532 |
+
np.mean(st.session_state.working_seed[:,10]),
|
533 |
+
np.max(st.session_state.working_seed[:,10]),
|
534 |
+
np.std(st.session_state.working_seed[:,10])
|
535 |
+
],
|
536 |
+
'Proj': [
|
537 |
+
np.min(st.session_state.working_seed[:,11]),
|
538 |
+
np.mean(st.session_state.working_seed[:,11]),
|
539 |
+
np.max(st.session_state.working_seed[:,11]),
|
540 |
+
np.std(st.session_state.working_seed[:,11])
|
541 |
+
],
|
542 |
+
'Own': [
|
543 |
+
np.min(st.session_state.working_seed[:,16]),
|
544 |
+
np.mean(st.session_state.working_seed[:,16]),
|
545 |
+
np.max(st.session_state.working_seed[:,16]),
|
546 |
+
np.std(st.session_state.working_seed[:,16])
|
547 |
+
]
|
548 |
+
})
|
549 |
+
elif site_var == 'Fanduel':
|
550 |
+
summary_df = pd.DataFrame({
|
551 |
+
'Metric': ['Min', 'Average', 'Max', 'STDdev'],
|
552 |
+
'Salary': [
|
553 |
+
np.min(st.session_state.working_seed[:,9]),
|
554 |
+
np.mean(st.session_state.working_seed[:,9]),
|
555 |
+
np.max(st.session_state.working_seed[:,9]),
|
556 |
+
np.std(st.session_state.working_seed[:,9])
|
557 |
+
],
|
558 |
+
'Proj': [
|
559 |
+
np.min(st.session_state.working_seed[:,10]),
|
560 |
+
np.mean(st.session_state.working_seed[:,10]),
|
561 |
+
np.max(st.session_state.working_seed[:,10]),
|
562 |
+
np.std(st.session_state.working_seed[:,10])
|
563 |
+
],
|
564 |
+
'Own': [
|
565 |
+
np.min(st.session_state.working_seed[:,15]),
|
566 |
+
np.mean(st.session_state.working_seed[:,15]),
|
567 |
+
np.max(st.session_state.working_seed[:,15]),
|
568 |
+
np.std(st.session_state.working_seed[:,15])
|
569 |
+
]
|
570 |
+
})
|
571 |
+
|
572 |
+
# Set the index of the summary dataframe as the "Metric" column
|
573 |
+
summary_df = summary_df.set_index('Metric')
|
574 |
+
|
575 |
+
# Display the summary dataframe
|
576 |
+
st.subheader("Optimal Statistics")
|
577 |
+
st.dataframe(summary_df.style.format({
|
578 |
+
'Salary': '{:.2f}',
|
579 |
+
'Proj': '{:.2f}',
|
580 |
+
'Own': '{:.2f}'
|
581 |
+
}).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own']), use_container_width=True)
|
582 |
|
583 |
with st.container():
|
584 |
tab1, tab2 = st.tabs(["Display Frequency", "Seed Frame Frequency"])
|
585 |
with tab1:
|
586 |
if 'data_export_display' in st.session_state:
|
587 |
if site_var == 'Draftkings':
|
588 |
+
if slate_type_var3 == 'Regular':
|
589 |
+
player_columns = st.session_state.data_export_display.iloc[:, :10]
|
590 |
+
elif slate_type_var3 == 'Showdown':
|
591 |
+
player_columns = st.session_state.data_export_display.iloc[:, :6]
|
592 |
elif site_var == 'Fanduel':
|
593 |
+
if slate_type_var3 == 'Regular':
|
594 |
+
player_columns = st.session_state.data_export_display.iloc[:, :9]
|
595 |
+
elif slate_type_var3 == 'Showdown':
|
596 |
+
player_columns = st.session_state.data_export_display.iloc[:, :5]
|
597 |
|
598 |
# Flatten the DataFrame and count unique values
|
599 |
value_counts = player_columns.values.flatten().tolist()
|
|
|
627 |
with tab2:
|
628 |
if 'working_seed' in st.session_state:
|
629 |
if site_var == 'Draftkings':
|
630 |
+
if slate_type_var3 == 'Regular':
|
631 |
+
player_columns = st.session_state.working_seed[:, :10]
|
632 |
+
elif slate_type_var3 == 'Showdown':
|
633 |
+
player_columns = st.session_state.working_seed[:, :7]
|
634 |
elif site_var == 'Fanduel':
|
635 |
+
if slate_type_var3 == 'Regular':
|
636 |
+
player_columns = st.session_state.working_seed[:, :9]
|
637 |
+
elif slate_type_var3 == 'Showdown':
|
638 |
+
player_columns = st.session_state.working_seed[:, :6]
|
639 |
|
640 |
# Flatten the DataFrame and count unique values
|
641 |
value_counts = player_columns.flatten().tolist()
|