James McCool
commited on
Commit
·
95ffa8b
1
Parent(s):
f5bf222
Update projection names handling in app.py: replace direct reference to projections DataFrame with session state for improved data consistency and clarity in name matching logic.
Browse files
app.py
CHANGED
|
@@ -158,7 +158,7 @@ with tab1:
|
|
| 158 |
|
| 159 |
# Get names from projections
|
| 160 |
csv_names = st.session_state['csv_file']['Name'].tolist()
|
| 161 |
-
projection_names =
|
| 162 |
|
| 163 |
# Create match dictionary for portfolio names to projection names
|
| 164 |
portfolio_match_dict = {}
|
|
@@ -205,7 +205,6 @@ with tab1:
|
|
| 205 |
unmatched_proj_names.append(projections_name)
|
| 206 |
|
| 207 |
# Update projections with matched names
|
| 208 |
-
projections = st.session_state['projections_df'].copy()
|
| 209 |
projections['player_names'] = projections['player_names'].map(lambda x: projections_match_dict.get(x, x))
|
| 210 |
st.session_state['projections_df'] = projections
|
| 211 |
|
|
|
|
| 158 |
|
| 159 |
# Get names from projections
|
| 160 |
csv_names = st.session_state['csv_file']['Name'].tolist()
|
| 161 |
+
projection_names = projections['player_names'].tolist()
|
| 162 |
|
| 163 |
# Create match dictionary for portfolio names to projection names
|
| 164 |
portfolio_match_dict = {}
|
|
|
|
| 205 |
unmatched_proj_names.append(projections_name)
|
| 206 |
|
| 207 |
# Update projections with matched names
|
|
|
|
| 208 |
projections['player_names'] = projections['player_names'].map(lambda x: projections_match_dict.get(x, x))
|
| 209 |
st.session_state['projections_df'] = projections
|
| 210 |
|