st.AgGrid filter / seleted column and row to dataframe (only selected column and row to df)

I can effortlessly extract data from selected columns and rows in st.AgGrid or filter data by column and row to match the Excel results shown in the attached image. However, I wish to transfer the selected columns and rows into a DataFrame. Despite numerous attempts using various methods and commands, I have only been able to retrieve filtered rows with all columns, rather than the specific selected columns. I would appreciate your guidance on how to obtain the selected columns and rows from st.AgGrid in a manner similar to the Excel results.
see all columns 10 with diffrent row type

i selected only three field cuntry , person and total with row selection country only India see in picture


save this three selected column in csv file

save in csv

see filter data in csv file only three columns

Could you please provide guidance on how to transfer the data from the selected column of the st.aggrid filter to a DataFrame, as shown in the image above? I would like to include only the selected column in the DataFrame.

please give me the right code

1 Like

Maybe can this snippet help you: