Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -245,9 +245,9 @@ def create_random_portfolio(Total_Sample_Size, raw_baselines, field_growth):
|
|
245 |
if max_var <= 10:
|
246 |
ranges_dict['g_range'] = round(max_var)
|
247 |
elif max_var > 10 and max_var <= 16:
|
248 |
-
ranges_dict['dst_range'] = round(max_var)
|
249 |
elif max_var > 16:
|
250 |
-
ranges_dict['dst_range'] = round(max_var)
|
251 |
|
252 |
# Generate random portfolios
|
253 |
rng = np.random.default_rng()
|
@@ -287,6 +287,8 @@ def get_correlated_dk_portfolio_for_sim(Total_Sample_Size, sharp_split, field_gr
|
|
287 |
|
288 |
RandomPortfolio, maps_dict, ranges_dict, full_pos_player_dict = create_random_portfolio(sizesplit, raw_baselines, field_growth)
|
289 |
|
|
|
|
|
290 |
RandomPortfolio['C1'] = pd.Series(list(RandomPortfolio['C1'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
291 |
RandomPortfolio['C2'] = pd.Series(list(RandomPortfolio['C2'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
292 |
RandomPortfolio['W1'] = pd.Series(list(RandomPortfolio['W1'].map(full_pos_player_dict['pos_dicts'][1])), dtype="string[pyarrow]")
|
@@ -1115,6 +1117,7 @@ with tab2:
|
|
1115 |
ds_raw = ds_raw.sort_values(by=['Own', 'Value'], ascending=False)
|
1116 |
|
1117 |
gs_raw = Overall_Proj[Overall_Proj.Position == 'G']
|
|
|
1118 |
gs_raw.dropna(subset=['Median']).reset_index(drop=True)
|
1119 |
gs_raw = gs_raw.reset_index(drop=True)
|
1120 |
gs_raw = gs_raw.sort_values(by=['Own', 'Median'], ascending=False)
|
|
|
245 |
if max_var <= 10:
|
246 |
ranges_dict['g_range'] = round(max_var)
|
247 |
elif max_var > 10 and max_var <= 16:
|
248 |
+
ranges_dict['dst_range'] = round(max_var / 1.5)
|
249 |
elif max_var > 16:
|
250 |
+
ranges_dict['dst_range'] = round(max_var / 2)
|
251 |
|
252 |
# Generate random portfolios
|
253 |
rng = np.random.default_rng()
|
|
|
287 |
|
288 |
RandomPortfolio, maps_dict, ranges_dict, full_pos_player_dict = create_random_portfolio(sizesplit, raw_baselines, field_growth)
|
289 |
|
290 |
+
st.table(RandomPortfolio.head(50))
|
291 |
+
|
292 |
RandomPortfolio['C1'] = pd.Series(list(RandomPortfolio['C1'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
293 |
RandomPortfolio['C2'] = pd.Series(list(RandomPortfolio['C2'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
294 |
RandomPortfolio['W1'] = pd.Series(list(RandomPortfolio['W1'].map(full_pos_player_dict['pos_dicts'][1])), dtype="string[pyarrow]")
|
|
|
1117 |
ds_raw = ds_raw.sort_values(by=['Own', 'Value'], ascending=False)
|
1118 |
|
1119 |
gs_raw = Overall_Proj[Overall_Proj.Position == 'G']
|
1120 |
+
gs_raw = gs_raw[gs_raw['Median'] > 0]
|
1121 |
gs_raw.dropna(subset=['Median']).reset_index(drop=True)
|
1122 |
gs_raw = gs_raw.reset_index(drop=True)
|
1123 |
gs_raw = gs_raw.sort_values(by=['Own', 'Median'], ascending=False)
|