James McCool commited on
Commit
95b2e04
·
1 Parent(s): e16cb76

Fix export logic in app.py: update the export base to concatenate the current portfolio instead of the export file, ensuring accurate data representation when adding to the export.

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -1105,13 +1105,12 @@ with tab2:
1105
  st.download_button(label="Download Portfolio", data=st.session_state['export_file'].to_csv(index=False), file_name="portfolio.csv", mime="text/csv")
1106
  with merge_port:
1107
  if st.button("Add to export"):
1108
- st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['export_file']])
1109
  else:
1110
  st.error("No portfolio to download")
1111
 
1112
  display_frame_source = st.selectbox("Display:", options=['Portfolio', 'Export Base'], key='display_frame_source')
1113
  if display_frame_source == 'Portfolio':
1114
- # Add pagination controls below the dataframe
1115
  total_rows = len(st.session_state['portfolio'])
1116
  rows_per_page = 500
1117
  total_pages = (total_rows + rows_per_page - 1) // rows_per_page # Ceiling division
 
1105
  st.download_button(label="Download Portfolio", data=st.session_state['export_file'].to_csv(index=False), file_name="portfolio.csv", mime="text/csv")
1106
  with merge_port:
1107
  if st.button("Add to export"):
1108
+ st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['portfolio']])
1109
  else:
1110
  st.error("No portfolio to download")
1111
 
1112
  display_frame_source = st.selectbox("Display:", options=['Portfolio', 'Export Base'], key='display_frame_source')
1113
  if display_frame_source == 'Portfolio':
 
1114
  total_rows = len(st.session_state['portfolio'])
1115
  rows_per_page = 500
1116
  total_pages = (total_rows + rows_per_page - 1) // rows_per_page # Ceiling division