James McCool commited on
Commit
1fe7139
·
1 Parent(s): 9251b5c

Update row selection method in 'app.py' for custom export by replacing number input with multiselect, enhancing user experience and flexibility in managing portfolio exports.

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1984,9 +1984,9 @@ if selected_tab == 'Manage Portfolio':
1984
  st.session_state['export_base'] = st.session_state['export_base'].reset_index(drop=True)
1985
  with partial_col:
1986
  if 'export_merge' in st.session_state:
1987
- select_custom_index = st.number_input("Select rows to add (from top)", min_value=0, max_value=len(st.session_state['export_merge']), value=0)
1988
  if st.button("Add selected to Custom Export"):
1989
- st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['export_merge'].head(select_custom_index)])
1990
  st.session_state['export_base'] = st.session_state['export_base'].drop_duplicates()
1991
  st.session_state['export_base'] = st.session_state['export_base'].reset_index(drop=True)
1992
  with clear_export:
@@ -2059,8 +2059,7 @@ if selected_tab == 'Manage Portfolio':
2059
  ),
2060
  },
2061
  height=499,
2062
- use_container_width=True,
2063
- hide_index=True
2064
  )
2065
  player_stats_col, stack_stats_col, combos_col = st.tabs(['Player Stats', 'Stack Stats', 'Combos'])
2066
  with player_stats_col:
 
1984
  st.session_state['export_base'] = st.session_state['export_base'].reset_index(drop=True)
1985
  with partial_col:
1986
  if 'export_merge' in st.session_state:
1987
+ select_custom_index = st.multiselect("Select rows to add (from top)", options=st.session_state['export_merge'].index, default=[])
1988
  if st.button("Add selected to Custom Export"):
1989
+ st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['export_merge'].loc[select_custom_index]])
1990
  st.session_state['export_base'] = st.session_state['export_base'].drop_duplicates()
1991
  st.session_state['export_base'] = st.session_state['export_base'].reset_index(drop=True)
1992
  with clear_export:
 
2059
  ),
2060
  },
2061
  height=499,
2062
+ use_container_width=True
 
2063
  )
2064
  player_stats_col, stack_stats_col, combos_col = st.tabs(['Player Stats', 'Stack Stats', 'Combos'])
2065
  with player_stats_col: