James McCool
commited on
Commit
·
3213b6b
1
Parent(s):
2496c14
Add handling for 'All' entry_parse_var in app.py
Browse files- Introduced a condition to set 'calc_toggle' to True when 'entry_parse_var' is 'All', ensuring consistent behavior during calculations.
- Added a new 'finish' column to the working DataFrame, improving data tracking and presentation for percentile calculations.
app.py
CHANGED
@@ -120,6 +120,8 @@ with tab2:
|
|
120 |
if entry_parse_var == 'Specific' and entry_names:
|
121 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
122 |
st.session_state['calc_toggle'] = True
|
|
|
|
|
123 |
|
124 |
if 'Contest' in st.session_state and 'projections_df' in st.session_state and st.session_state['calc_toggle']:
|
125 |
if type_var == 'Classic':
|
@@ -187,6 +189,7 @@ with tab2:
|
|
187 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
188 |
working_df = working_df.reset_index()
|
189 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
|
|
190 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
191 |
|
192 |
# Initialize pagination in session state if not exists
|
|
|
120 |
if entry_parse_var == 'Specific' and entry_names:
|
121 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
122 |
st.session_state['calc_toggle'] = True
|
123 |
+
elif entry_parse_var == 'All':
|
124 |
+
st.session_state['calc_toggle'] = True
|
125 |
|
126 |
if 'Contest' in st.session_state and 'projections_df' in st.session_state and st.session_state['calc_toggle']:
|
127 |
if type_var == 'Classic':
|
|
|
189 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
190 |
working_df = working_df.reset_index()
|
191 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
192 |
+
working_df['finish'] = working_df['index']
|
193 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
194 |
|
195 |
# Initialize pagination in session state if not exists
|