Multichem commited on
Commit
c0f69b4
·
1 Parent(s): b1647dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -512,11 +512,10 @@ def get_uncorrelated_portfolio_for_sim(Total_Sample_Size):
512
 
513
  return RandomPortfolio, maps_dict
514
 
515
- player_stats = player_stat_table()
516
  dk_roo_raw = load_dk_player_projections()
517
  fd_roo_raw = load_fd_player_projections()
518
  t_stamp = f"Last Update: " + str(dk_roo_raw['timestamp'][0]) + f" CST"
519
- site_slates = set_slate_teams()
520
  dkid_dict, fdid_dict = set_export_ids()
521
 
522
  static_exposure = pd.DataFrame(columns=['Player', 'count'])
@@ -815,6 +814,8 @@ with tab1:
815
  overall_exposure = overall_exposure.sort_values(by='Exposure', ascending=False)
816
  overall_exposure['Exposure'] = overall_exposure['Exposure'].astype(float).map(lambda n: '{:.2%}'.format(n))
817
 
 
 
818
  with st.container():
819
  col1, col2 = st.columns([1, 6])
820
 
@@ -865,7 +866,6 @@ with tab2:
865
  dk_roo_raw = load_dk_player_projections()
866
  fd_roo_raw = load_fd_player_projections()
867
  t_stamp = f"Last Update: " + str(dk_roo_raw['timestamp'][0]) + f" CST"
868
- site_slates = set_slate_teams()
869
  dkid_dict, fdid_dict = set_export_ids()
870
 
871
  slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Thurs-Mon Slate', 'User'))
@@ -882,6 +882,8 @@ with tab2:
882
  elif slate_var1 != 'User':
883
  raw_baselines = fd_roo_raw[fd_roo_raw['slate'] == str(slate_var1)]
884
  raw_baselines = raw_baselines[raw_baselines['version'] == 'overall']
 
 
885
  st.info("If you are uploading a portfolio, note that there is an adjustments to projections and deviation mapping to prevent 'Projection Bias' and create a fair simulation")
886
  insert_port1 = st.selectbox("Are you uploading a portfolio?", ('No', 'Yes'), key='insert_port1')
887
  if insert_port1 == 'Yes':
@@ -1248,10 +1250,10 @@ with tab2:
1248
  SimVar += 1
1249
 
1250
 
1251
- # del smple_arrays
1252
- # del smple_arrays1
1253
- # del smple_arrays2
1254
- # del final_array
1255
  # del best_lineup
1256
  st.write('Contest simulation complete')
1257
  # Initial setup
@@ -1276,6 +1278,9 @@ with tab2:
1276
  elif site_var1 == 'Fanduel':
1277
  replace_dict = fdid_dict
1278
 
 
 
 
1279
  for col in columns_to_replace:
1280
  st.session_state.Sim_Winner_Export[col].replace(replace_dict, inplace=True)
1281
 
 
512
 
513
  return RandomPortfolio, maps_dict
514
 
515
+
516
  dk_roo_raw = load_dk_player_projections()
517
  fd_roo_raw = load_fd_player_projections()
518
  t_stamp = f"Last Update: " + str(dk_roo_raw['timestamp'][0]) + f" CST"
 
519
  dkid_dict, fdid_dict = set_export_ids()
520
 
521
  static_exposure = pd.DataFrame(columns=['Player', 'count'])
 
814
  overall_exposure = overall_exposure.sort_values(by='Exposure', ascending=False)
815
  overall_exposure['Exposure'] = overall_exposure['Exposure'].astype(float).map(lambda n: '{:.2%}'.format(n))
816
 
817
+ del static_exposure
818
+
819
  with st.container():
820
  col1, col2 = st.columns([1, 6])
821
 
 
866
  dk_roo_raw = load_dk_player_projections()
867
  fd_roo_raw = load_fd_player_projections()
868
  t_stamp = f"Last Update: " + str(dk_roo_raw['timestamp'][0]) + f" CST"
 
869
  dkid_dict, fdid_dict = set_export_ids()
870
 
871
  slate_var1 = st.radio("Which data are you loading?", ('Main Slate', 'Secondary Slate', 'Thurs-Mon Slate', 'User'))
 
882
  elif slate_var1 != 'User':
883
  raw_baselines = fd_roo_raw[fd_roo_raw['slate'] == str(slate_var1)]
884
  raw_baselines = raw_baselines[raw_baselines['version'] == 'overall']
885
+ del dk_roo_raw
886
+ del fd_roo_raw
887
  st.info("If you are uploading a portfolio, note that there is an adjustments to projections and deviation mapping to prevent 'Projection Bias' and create a fair simulation")
888
  insert_port1 = st.selectbox("Are you uploading a portfolio?", ('No', 'Yes'), key='insert_port1')
889
  if insert_port1 == 'Yes':
 
1250
  SimVar += 1
1251
 
1252
 
1253
+ del vec_projection_map
1254
+ del vec_stdev_map
1255
+ del sample_arrays
1256
+ del final_array
1257
  # del best_lineup
1258
  st.write('Contest simulation complete')
1259
  # Initial setup
 
1278
  elif site_var1 == 'Fanduel':
1279
  replace_dict = fdid_dict
1280
 
1281
+ del dkid_dict
1282
+ del fdid_dict
1283
+
1284
  for col in columns_to_replace:
1285
  st.session_state.Sim_Winner_Export[col].replace(replace_dict, inplace=True)
1286