Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,6 +226,10 @@ with tab2:
|
|
| 226 |
elif row['Ownership'] <= max_own:
|
| 227 |
max_own = row['Ownership']
|
| 228 |
st.session_state.display_portfolio = display_portfolio
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
with col3:
|
| 230 |
player_check = st.selectbox('Select player to create comps', options = proj_dataframe['Player'].unique(), key='dk_player')
|
| 231 |
if st.button('Simulate appropriate pivots'):
|
|
@@ -323,19 +327,19 @@ with tab2:
|
|
| 323 |
proj_container = st.empty()
|
| 324 |
display_container = st.empty()
|
| 325 |
display_dl_container = st.empty()
|
| 326 |
-
|
|
|
|
| 327 |
with col1:
|
| 328 |
with proj_container:
|
| 329 |
proj_container = st.empty()
|
| 330 |
if 'display_portfolio' in st.session_state:
|
| 331 |
st.dataframe(st.session_state.display_portfolio.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 332 |
|
| 333 |
-
with display_container:
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
with col2:
|
| 338 |
-
freq_container = st.empty()
|
| 339 |
with freq_container:
|
| 340 |
freq_container = st.empty()
|
| 341 |
if 'player_freq' in st.session_state:
|
|
|
|
| 226 |
elif row['Ownership'] <= max_own:
|
| 227 |
max_own = row['Ownership']
|
| 228 |
st.session_state.display_portfolio = display_portfolio
|
| 229 |
+
st.session_state.player_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.display_portfolio.iloc[:,0:8].values, return_counts=True)),
|
| 230 |
+
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
| 231 |
+
st.session_state.player_freq['Freq'] = st.session_state.player_freq['Freq'] / len(st.session_state.display_portfolio)
|
| 232 |
+
st.session_state.player_freq = st.session_state.player_freq.set_index('Player')
|
| 233 |
with col3:
|
| 234 |
player_check = st.selectbox('Select player to create comps', options = proj_dataframe['Player'].unique(), key='dk_player')
|
| 235 |
if st.button('Simulate appropriate pivots'):
|
|
|
|
| 327 |
proj_container = st.empty()
|
| 328 |
display_container = st.empty()
|
| 329 |
display_dl_container = st.empty()
|
| 330 |
+
freq_container = st.empty()
|
| 331 |
+
col1, col2 = st.columns([7, 2])
|
| 332 |
with col1:
|
| 333 |
with proj_container:
|
| 334 |
proj_container = st.empty()
|
| 335 |
if 'display_portfolio' in st.session_state:
|
| 336 |
st.dataframe(st.session_state.display_portfolio.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 337 |
|
| 338 |
+
# with display_container:
|
| 339 |
+
# display_container = st.empty()
|
| 340 |
+
# if 'final_Proj' in st.session_state:
|
| 341 |
+
# st.dataframe(st.session_state.final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
| 342 |
with col2:
|
|
|
|
| 343 |
with freq_container:
|
| 344 |
freq_container = st.empty()
|
| 345 |
if 'player_freq' in st.session_state:
|