Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -192,11 +192,17 @@ with tab1:
|
|
192 |
split_portfolio['UTIL'].map(player_own_dict)])
|
193 |
|
194 |
display_portfolio = split_portfolio[['PG', 'SG', 'SF', 'PF', 'C', 'G', 'F', 'UTIL', 'Salary', 'Projection', 'Ownership']]
|
|
|
195 |
hold_portfolio = display_portfolio.sort_values(by='Projection', ascending=False)
|
|
|
|
|
|
|
|
|
|
|
196 |
gc.collect()
|
197 |
|
198 |
with tab2:
|
199 |
-
col1, col2, col3 = st.columns([
|
200 |
with col1:
|
201 |
hold_container = st.empty()
|
202 |
if st.button("Load/Reset Data", key='reset1'):
|
@@ -204,6 +210,9 @@ with tab2:
|
|
204 |
del st.session_state[key]
|
205 |
display_portfolio = hold_portfolio
|
206 |
st.session_state.display_portfolio = display_portfolio
|
|
|
|
|
|
|
207 |
if st.button("Trim Lineups", key='trim1'):
|
208 |
max_proj = 10000
|
209 |
max_own = display_portfolio['Ownership'].iloc[0]
|
@@ -305,10 +314,6 @@ with tab2:
|
|
305 |
final_Proj['Player_swap'] = player_check
|
306 |
st.session_state.final_Proj = final_Proj
|
307 |
|
308 |
-
st.session_state.player_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.display_portfolio.iloc[:,0:9].values, return_counts=True)),
|
309 |
-
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
310 |
-
st.session_state.player_freq['Freq'] = st.session_state.player_freq['Freq'].astype(int)
|
311 |
-
|
312 |
hold_container = st.empty()
|
313 |
|
314 |
with col2:
|
|
|
192 |
split_portfolio['UTIL'].map(player_own_dict)])
|
193 |
|
194 |
display_portfolio = split_portfolio[['PG', 'SG', 'SF', 'PF', 'C', 'G', 'F', 'UTIL', 'Salary', 'Projection', 'Ownership']]
|
195 |
+
st.session_state.display_portfolio = display_portfolio
|
196 |
hold_portfolio = display_portfolio.sort_values(by='Projection', ascending=False)
|
197 |
+
|
198 |
+
st.session_state.player_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.display_portfolio.iloc[:,0:9].values, return_counts=True)),
|
199 |
+
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
200 |
+
st.session_state.player_freq['Freq'] = st.session_state.player_freq['Freq'].astype(int)
|
201 |
+
|
202 |
gc.collect()
|
203 |
|
204 |
with tab2:
|
205 |
+
col1, col2, col3 = st.columns([1, 8, 1])
|
206 |
with col1:
|
207 |
hold_container = st.empty()
|
208 |
if st.button("Load/Reset Data", key='reset1'):
|
|
|
210 |
del st.session_state[key]
|
211 |
display_portfolio = hold_portfolio
|
212 |
st.session_state.display_portfolio = display_portfolio
|
213 |
+
st.session_state.player_freq = pd.DataFrame(np.column_stack(np.unique(st.session_state.display_portfolio.iloc[:,0:9].values, return_counts=True)),
|
214 |
+
columns=['Player','Freq']).sort_values('Freq', ascending=False).reset_index(drop=True)
|
215 |
+
st.session_state.player_freq['Freq'] = st.session_state.player_freq['Freq'].astype(int)
|
216 |
if st.button("Trim Lineups", key='trim1'):
|
217 |
max_proj = 10000
|
218 |
max_own = display_portfolio['Ownership'].iloc[0]
|
|
|
314 |
final_Proj['Player_swap'] = player_check
|
315 |
st.session_state.final_Proj = final_Proj
|
316 |
|
|
|
|
|
|
|
|
|
317 |
hold_container = st.empty()
|
318 |
|
319 |
with col2:
|