Dear sir My code is functioning correctly; however, it currently displays only one column. My user requires five columns. I would appreciate your guidance on how to retrieve multiple columns from the st.aggrid filtered data. Thank you in advance for your assistance. Here is my code.
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
df = pd.DataFrame({‘Name’: [‘A’, ‘B’, ‘C’], ‘Age’: [25, 24, 1]})
container = st.container()
return_df = AgGrid(data = df, data_return_mode = ‘FILTERED’)
st.session_state[“names_active”] = list(return_df[[‘Name’,‘Age’]) # this give me eror
#st.session_state[“names_active”] = list(return_df[‘data’][‘Name’]) # this run ok
with container:
st.markdown(st.session_state[“names_active”])
if “names_active” not in st.session_state:
st.session_state[“names_active”] = list(df[‘Name’])
st.markdown(st.session_state[“names_active”])
st.session_state[“names_active”] = list(return_df[[‘Name’,‘Age’]) # this give me eror