James McCool commited on
Commit
c2420ef
·
1 Parent(s): 311d2c7

Update app.py to adjust column indices for player metrics in DraftKings and FanDuel sections, ensuring accurate data retrieval and enhancing the overall functionality of the application.

Browse files
Files changed (1) hide show
  1. app.py +28 -28
app.py CHANGED
@@ -478,44 +478,44 @@ with tab3:
478
  summary_df = pd.DataFrame({
479
  'Metric': ['Min', 'Average', 'Max', 'STDdev'],
480
  'Salary': [
481
- np.min(st.session_state.working_seed[:,6]),
482
- np.mean(st.session_state.working_seed[:,6]),
483
- np.max(st.session_state.working_seed[:,6]),
484
- np.std(st.session_state.working_seed[:,6])
485
  ],
486
  'Proj': [
487
- np.min(st.session_state.working_seed[:,7]),
488
- np.mean(st.session_state.working_seed[:,7]),
489
- np.max(st.session_state.working_seed[:,7]),
490
- np.std(st.session_state.working_seed[:,7])
491
  ],
492
  'Own': [
493
- np.min(st.session_state.working_seed[:,8]),
494
- np.mean(st.session_state.working_seed[:,8]),
495
- np.max(st.session_state.working_seed[:,8]),
496
- np.std(st.session_state.working_seed[:,8])
497
  ]
498
  })
499
  elif site_var == 'Fanduel':
500
  summary_df = pd.DataFrame({
501
  'Metric': ['Min', 'Average', 'Max', 'STDdev'],
502
  'Salary': [
503
- np.min(st.session_state.working_seed[:,6]),
504
- np.mean(st.session_state.working_seed[:,6]),
505
- np.max(st.session_state.working_seed[:,6]),
506
- np.std(st.session_state.working_seed[:,6])
507
- ],
508
- 'Proj': [
509
- np.min(st.session_state.working_seed[:,7]),
510
- np.mean(st.session_state.working_seed[:,7]),
511
- np.max(st.session_state.working_seed[:,7]),
512
- np.std(st.session_state.working_seed[:,7])
513
- ],
514
- 'Own': [
515
  np.min(st.session_state.working_seed[:,8]),
516
  np.mean(st.session_state.working_seed[:,8]),
517
  np.max(st.session_state.working_seed[:,8]),
518
  np.std(st.session_state.working_seed[:,8])
 
 
 
 
 
 
 
 
 
 
 
 
519
  ]
520
  })
521
 
@@ -535,9 +535,9 @@ with tab3:
535
  with tab1:
536
  if 'data_export_display' in st.session_state:
537
  if site_var == 'Draftkings':
538
- player_columns = st.session_state.data_export_display.iloc[:, :6]
539
  elif site_var == 'Fanduel':
540
- player_columns = st.session_state.data_export_display.iloc[:, :6]
541
 
542
  # Flatten the DataFrame and count unique values
543
  value_counts = player_columns.values.flatten().tolist()
@@ -571,9 +571,9 @@ with tab3:
571
  with tab2:
572
  if 'working_seed' in st.session_state:
573
  if site_var == 'Draftkings':
574
- player_columns = st.session_state.working_seed[:, :6]
575
  elif site_var == 'Fanduel':
576
- player_columns = st.session_state.working_seed[:, :6]
577
 
578
  # Flatten the DataFrame and count unique values
579
  value_counts = player_columns.flatten().tolist()
 
478
  summary_df = pd.DataFrame({
479
  'Metric': ['Min', 'Average', 'Max', 'STDdev'],
480
  'Salary': [
481
+ np.min(st.session_state.working_seed[:,9]),
482
+ np.mean(st.session_state.working_seed[:,9]),
483
+ np.max(st.session_state.working_seed[:,9]),
484
+ np.std(st.session_state.working_seed[:,9])
485
  ],
486
  'Proj': [
487
+ np.min(st.session_state.working_seed[:,10]),
488
+ np.mean(st.session_state.working_seed[:,10]),
489
+ np.max(st.session_state.working_seed[:,10]),
490
+ np.std(st.session_state.working_seed[:,10])
491
  ],
492
  'Own': [
493
+ np.min(st.session_state.working_seed[:,15]),
494
+ np.mean(st.session_state.working_seed[:,15]),
495
+ np.max(st.session_state.working_seed[:,15]),
496
+ np.std(st.session_state.working_seed[:,15])
497
  ]
498
  })
499
  elif site_var == 'Fanduel':
500
  summary_df = pd.DataFrame({
501
  'Metric': ['Min', 'Average', 'Max', 'STDdev'],
502
  'Salary': [
 
 
 
 
 
 
 
 
 
 
 
 
503
  np.min(st.session_state.working_seed[:,8]),
504
  np.mean(st.session_state.working_seed[:,8]),
505
  np.max(st.session_state.working_seed[:,8]),
506
  np.std(st.session_state.working_seed[:,8])
507
+ ],
508
+ 'Proj': [
509
+ np.min(st.session_state.working_seed[:,9]),
510
+ np.mean(st.session_state.working_seed[:,9]),
511
+ np.max(st.session_state.working_seed[:,9]),
512
+ np.std(st.session_state.working_seed[:,9])
513
+ ],
514
+ 'Own': [
515
+ np.min(st.session_state.working_seed[:,14]),
516
+ np.mean(st.session_state.working_seed[:,14]),
517
+ np.max(st.session_state.working_seed[:,14]),
518
+ np.std(st.session_state.working_seed[:,14])
519
  ]
520
  })
521
 
 
535
  with tab1:
536
  if 'data_export_display' in st.session_state:
537
  if site_var == 'Draftkings':
538
+ player_columns = st.session_state.data_export_display.iloc[:, :10]
539
  elif site_var == 'Fanduel':
540
+ player_columns = st.session_state.data_export_display.iloc[:, :9]
541
 
542
  # Flatten the DataFrame and count unique values
543
  value_counts = player_columns.values.flatten().tolist()
 
571
  with tab2:
572
  if 'working_seed' in st.session_state:
573
  if site_var == 'Draftkings':
574
+ player_columns = st.session_state.working_seed[:, :10]
575
  elif site_var == 'Fanduel':
576
+ player_columns = st.session_state.working_seed[:, :9]
577
 
578
  # Flatten the DataFrame and count unique values
579
  value_counts = player_columns.flatten().tolist()