Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -252,7 +252,7 @@ def create_random_portfolio(Total_Sample_Size, raw_baselines, field_growth):
|
|
252 |
# Generate random portfolios
|
253 |
rng = np.random.default_rng()
|
254 |
total_elements = [2, 3, 2, 1, 1]
|
255 |
-
keys = ['c', 'w', 'd', '
|
256 |
|
257 |
all_choices = [rng.choice(ranges_dict[f"{key}_range"], size=(Total_Sample_Size, elem)) for key, elem in zip(keys, total_elements)]
|
258 |
RandomPortfolio = pd.DataFrame(np.hstack(all_choices), columns=['C1', 'C2', 'W1', 'W2', 'W3', 'D1', 'D2', 'G', 'UTIL'])
|
@@ -1367,9 +1367,9 @@ with tab2:
|
|
1367 |
)
|
1368 |
|
1369 |
with st.container():
|
1370 |
-
tab1 = st.tabs(['Overall Exposures'])
|
1371 |
# tab1, tab2, tab3, tab4, tab5, tab6, tab7 = st.tabs(['Overall Exposures', 'QB Exposures', 'RB Exposures', 'WR Exposures', 'TE Exposures', 'FLEX Exposures', 'DST Exposures'])
|
1372 |
-
with tab1:
|
1373 |
if 'player_freq' in st.session_state:
|
1374 |
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
1375 |
st.download_button(
|
@@ -1442,4 +1442,4 @@ del insert_port1, Contest_Size, sharp_split, Strength_var, scaling_var, Sort_fun
|
|
1442 |
del raw_baselines
|
1443 |
del freq_format
|
1444 |
|
1445 |
-
gc.collect()
|
|
|
252 |
# Generate random portfolios
|
253 |
rng = np.random.default_rng()
|
254 |
total_elements = [2, 3, 2, 1, 1]
|
255 |
+
keys = ['c', 'w', 'd', 'util', 'g']
|
256 |
|
257 |
all_choices = [rng.choice(ranges_dict[f"{key}_range"], size=(Total_Sample_Size, elem)) for key, elem in zip(keys, total_elements)]
|
258 |
RandomPortfolio = pd.DataFrame(np.hstack(all_choices), columns=['C1', 'C2', 'W1', 'W2', 'W3', 'D1', 'D2', 'G', 'UTIL'])
|
|
|
1367 |
)
|
1368 |
|
1369 |
with st.container():
|
1370 |
+
# tab1 = st.tabs(['Overall Exposures'])
|
1371 |
# tab1, tab2, tab3, tab4, tab5, tab6, tab7 = st.tabs(['Overall Exposures', 'QB Exposures', 'RB Exposures', 'WR Exposures', 'TE Exposures', 'FLEX Exposures', 'DST Exposures'])
|
1372 |
+
# with tab1:
|
1373 |
if 'player_freq' in st.session_state:
|
1374 |
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
1375 |
st.download_button(
|
|
|
1442 |
del raw_baselines
|
1443 |
del freq_format
|
1444 |
|
1445 |
+
gc.collect()
|