James McCool
commited on
Commit
·
3ab0af0
1
Parent(s):
c039cd3
Refactor position filtering to use a select box instead of multiselect, enhancing user experience by simplifying position selection.
Browse files
app.py
CHANGED
|
@@ -1035,11 +1035,7 @@ def create_position_export_dict(column_name, csv_file, site_var, type_var, sport
|
|
| 1035 |
|
| 1036 |
def parse_portfolio_on_mapped(portfolio, map_dict, map_key, filter_keys, low_threshold, high_threshold, column_choices):
|
| 1037 |
mapping_port = portfolio[column_choices]
|
| 1038 |
-
print(mapping_port.head(10))
|
| 1039 |
-
print(map_key)
|
| 1040 |
-
print(map_dict[map_key])
|
| 1041 |
mapping_port = mapping_port.map(map_dict[map_key])
|
| 1042 |
-
print(mapping_port.head(10))
|
| 1043 |
|
| 1044 |
if map_key not in ['team_map', 'pos_map']:
|
| 1045 |
# Numerical mapping - filter by thresholds
|
|
@@ -2142,7 +2138,7 @@ if selected_tab == 'Manage Portfolio':
|
|
| 2142 |
|
| 2143 |
with st.expander('Position Filtering'):
|
| 2144 |
with st.form(key='position_filtering_form'):
|
| 2145 |
-
position_choice = st.
|
| 2146 |
position_filter = st.selectbox("Filter on:", options=pos_parse_options)
|
| 2147 |
if position_filter not in ['Position', 'Team']:
|
| 2148 |
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
|
|
|
| 1035 |
|
| 1036 |
def parse_portfolio_on_mapped(portfolio, map_dict, map_key, filter_keys, low_threshold, high_threshold, column_choices):
|
| 1037 |
mapping_port = portfolio[column_choices]
|
|
|
|
|
|
|
|
|
|
| 1038 |
mapping_port = mapping_port.map(map_dict[map_key])
|
|
|
|
| 1039 |
|
| 1040 |
if map_key not in ['team_map', 'pos_map']:
|
| 1041 |
# Numerical mapping - filter by thresholds
|
|
|
|
| 2138 |
|
| 2139 |
with st.expander('Position Filtering'):
|
| 2140 |
with st.form(key='position_filtering_form'):
|
| 2141 |
+
position_choice = st.selectbox("Position to filter", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], index=0)
|
| 2142 |
position_filter = st.selectbox("Filter on:", options=pos_parse_options)
|
| 2143 |
if position_filter not in ['Position', 'Team']:
|
| 2144 |
position_low_threshold = st.number_input("Low Threshold", value=0.0, min_value=0.0, step=1.0)
|