Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ gcservice_account = init_conn()
|
|
40 |
master_hold = 'https://docs.google.com/spreadsheets/d/1D526UlXmrz-8qxVcUKrA-u7f6FftUiBufxDnzQv980k/edit#gid=791804525'
|
41 |
|
42 |
|
43 |
-
@st.cache_resource(ttl =
|
44 |
def init_baselines():
|
45 |
sh = gcservice_account.open_by_url(master_hold)
|
46 |
worksheet = sh.worksheet('Pitcher_Proj')
|
@@ -225,7 +225,7 @@ with tab4:
|
|
225 |
flex_file = df.copy()
|
226 |
flex_file.rename(columns={"Name": "Player"}, inplace = True)
|
227 |
flex_file['Floor'] = (flex_file['Median'] * .15)
|
228 |
-
flex_file['Ceiling'] = np.where((flex_file['Median'] * flex_file['Ceiling_var'])
|
229 |
flex_file['STD'] = (flex_file['Median']/2)
|
230 |
flex_file = flex_file[['Player', 'Floor', 'Median', 'Ceiling', 'STD']]
|
231 |
|
@@ -237,7 +237,7 @@ with tab4:
|
|
237 |
overall_players = overall_file[['Player']]
|
238 |
|
239 |
for x in range(0,total_sims):
|
240 |
-
overall_file['g'] = np.random.
|
241 |
overall_file[x] = np.where((overall_file['g']<=overall_file['Ceiling']),overall_file['g'],overall_file['Ceiling'])
|
242 |
|
243 |
check_file = overall_file.copy()
|
|
|
40 |
master_hold = 'https://docs.google.com/spreadsheets/d/1D526UlXmrz-8qxVcUKrA-u7f6FftUiBufxDnzQv980k/edit#gid=791804525'
|
41 |
|
42 |
|
43 |
+
@st.cache_resource(ttl = 600)
|
44 |
def init_baselines():
|
45 |
sh = gcservice_account.open_by_url(master_hold)
|
46 |
worksheet = sh.worksheet('Pitcher_Proj')
|
|
|
225 |
flex_file = df.copy()
|
226 |
flex_file.rename(columns={"Name": "Player"}, inplace = True)
|
227 |
flex_file['Floor'] = (flex_file['Median'] * .15)
|
228 |
+
flex_file['Ceiling'] = np.where((flex_file['Median'] + (flex_file['Median'] * flex_file['Ceiling_var'])) > stat_cap, stat_cap - (flex_file['Median']/20), (flex_file['Median'] + (flex_file['Median'] * flex_file['Ceiling_var'])))
|
229 |
flex_file['STD'] = (flex_file['Median']/2)
|
230 |
flex_file = flex_file[['Player', 'Floor', 'Median', 'Ceiling', 'STD']]
|
231 |
|
|
|
237 |
overall_players = overall_file[['Player']]
|
238 |
|
239 |
for x in range(0,total_sims):
|
240 |
+
overall_file['g'] = np.random.gumbel(overall_file['Median'] * .5,overall_file['STD'])
|
241 |
overall_file[x] = np.where((overall_file['g']<=overall_file['Ceiling']),overall_file['g'],overall_file['Ceiling'])
|
242 |
|
243 |
check_file = overall_file.copy()
|