Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
cc5b9dd
1
Parent(s):
730a147
Remove redundant update of projections_df in app.py: eliminate unnecessary reassignment of projections_df with name mismatches, streamlining the session state management and improving code efficiency.
Browse files
app.py
CHANGED
|
@@ -142,9 +142,6 @@ with tab1:
|
|
| 142 |
if 'projections_df' not in st.session_state:
|
| 143 |
st.session_state['projections_df'] = projections.copy()
|
| 144 |
st.session_state['projections_df']['salary'] = (st.session_state['projections_df']['salary'].astype(str).str.replace(',', '').astype(float).astype(int))
|
| 145 |
-
|
| 146 |
-
# Update projections_df with any new matches
|
| 147 |
-
st.session_state['projections_df'] = find_name_mismatches(st.session_state['portfolio'], st.session_state['projections_df'])
|
| 148 |
try:
|
| 149 |
name_id_map = dict(zip(
|
| 150 |
st.session_state['csv_file']['Name'],
|
|
@@ -186,7 +183,6 @@ with tab1:
|
|
| 186 |
projections['upload_match'] = projections['player_names'].map(match_dict)
|
| 187 |
st.session_state['export_dict'] = match_dict
|
| 188 |
|
| 189 |
-
|
| 190 |
st.write(st.session_state['export_dict'])
|
| 191 |
st.session_state['origin_portfolio'] = st.session_state['portfolio'].copy()
|
| 192 |
|
|
|
|
| 142 |
if 'projections_df' not in st.session_state:
|
| 143 |
st.session_state['projections_df'] = projections.copy()
|
| 144 |
st.session_state['projections_df']['salary'] = (st.session_state['projections_df']['salary'].astype(str).str.replace(',', '').astype(float).astype(int))
|
|
|
|
|
|
|
|
|
|
| 145 |
try:
|
| 146 |
name_id_map = dict(zip(
|
| 147 |
st.session_state['csv_file']['Name'],
|
|
|
|
| 183 |
projections['upload_match'] = projections['player_names'].map(match_dict)
|
| 184 |
st.session_state['export_dict'] = match_dict
|
| 185 |
|
|
|
|
| 186 |
st.write(st.session_state['export_dict'])
|
| 187 |
st.session_state['origin_portfolio'] = st.session_state['portfolio'].copy()
|
| 188 |
|