James McCool
commited on
Commit
·
a8c9973
1
Parent(s):
265f036
Remove redundant player frame from session state and clean up unused variables in app.py
Browse files- Deleted the 'player_frame' from session state upon submission to ensure a fresh state for player selections.
- Removed unused variables related to player counts, streamlining the data processing logic for improved performance and clarity.
app.py
CHANGED
@@ -112,6 +112,8 @@ with tab2:
|
|
112 |
entry_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[])
|
113 |
submitted = st.form_submit_button("Submit")
|
114 |
if submitted:
|
|
|
|
|
115 |
# Apply entry name filter if specific entries are selected
|
116 |
if entry_parse_var == 'Specific' and entry_names:
|
117 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
@@ -180,12 +182,6 @@ with tab2:
|
|
180 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
181 |
working_df = working_df.drop('sorted', axis=1)
|
182 |
|
183 |
-
|
184 |
-
contest_players = set()
|
185 |
-
players_1per = set()
|
186 |
-
players_5per = set()
|
187 |
-
players_10per = set()
|
188 |
-
players_20per = set()
|
189 |
for col in player_columns:
|
190 |
contest_players = working_df.copy()
|
191 |
players_1per = working_df.nlargest(n=int(len(working_df) * 0.01), columns='actual_fpts')
|
|
|
112 |
entry_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[])
|
113 |
submitted = st.form_submit_button("Submit")
|
114 |
if submitted:
|
115 |
+
if 'player_frame' in st.session_state:
|
116 |
+
del st.session_state['player_frame']
|
117 |
# Apply entry name filter if specific entries are selected
|
118 |
if entry_parse_var == 'Specific' and entry_names:
|
119 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
|
|
182 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
183 |
working_df = working_df.drop('sorted', axis=1)
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
for col in player_columns:
|
186 |
contest_players = working_df.copy()
|
187 |
players_1per = working_df.nlargest(n=int(len(working_df) * 0.01), columns='actual_fpts')
|