James McCool
commited on
Commit
·
6a8dfe1
1
Parent(s):
9c21d34
Update team filtering logic to use unique team values from the working frame, enhancing accuracy in portfolio management. Adjusted input prompts for better clarity in user selections.
Browse files
app.py
CHANGED
|
@@ -1044,7 +1044,7 @@ def parse_portfolio_on_mapped(portfolio, map_dict, map_key, filter_keys_pos, fil
|
|
| 1044 |
mask = low_mask & high_mask
|
| 1045 |
else:
|
| 1046 |
# String mapping - filter by inclusion in filter_keys
|
| 1047 |
-
mask = mapping_port.
|
| 1048 |
|
| 1049 |
return portfolio[mask]
|
| 1050 |
|
|
@@ -2143,7 +2143,7 @@ if selected_tab == 'Manage Portfolio':
|
|
| 2143 |
position_low_threshold = st.number_input("if filtering on Projection/Ownership/Salary, Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
| 2144 |
position_high_threshold = st.number_input("if filtering on Projection/Ownership/Salary, High Threshold", value=20000.0, min_value=0.0, step=1.0)
|
| 2145 |
filter_keys_pos = st.multiselect("if filtering on Position, Position(s) to keep", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], default=[])
|
| 2146 |
-
filter_keys_team = st.multiselect("if filtering on Team, Team(s) to keep", options=st.session_state['
|
| 2147 |
submitted_col, export_col = st.columns(2)
|
| 2148 |
with submitted_col:
|
| 2149 |
reg_submitted = st.form_submit_button("Portfolio")
|
|
|
|
| 1044 |
mask = low_mask & high_mask
|
| 1045 |
else:
|
| 1046 |
# String mapping - filter by inclusion in filter_keys
|
| 1047 |
+
mask = mapping_port.str.contains(filter_keys_pos) | mapping_port.isin(filter_keys_team)
|
| 1048 |
|
| 1049 |
return portfolio[mask]
|
| 1050 |
|
|
|
|
| 2143 |
position_low_threshold = st.number_input("if filtering on Projection/Ownership/Salary, Low Threshold", value=0.0, min_value=0.0, step=1.0)
|
| 2144 |
position_high_threshold = st.number_input("if filtering on Projection/Ownership/Salary, High Threshold", value=20000.0, min_value=0.0, step=1.0)
|
| 2145 |
filter_keys_pos = st.multiselect("if filtering on Position, Position(s) to keep", options=[col for col in st.session_state['working_frame'].columns if col not in excluded_cols], default=[])
|
| 2146 |
+
filter_keys_team = st.multiselect("if filtering on Team, Team(s) to keep", options=st.session_state['working_frame']['Team'].unique(), default=[])
|
| 2147 |
submitted_col, export_col = st.columns(2)
|
| 2148 |
with submitted_col:
|
| 2149 |
reg_submitted = st.form_submit_button("Portfolio")
|