How to st.datafreame convert to pandas dataframe / st.dataframe to array list python

Dear Supervisor,
I kindly request your guidance on how to convert or save a st.dataframe into a pandas DataFrame or an array list. Below is my simple code for your reference.

import streamlit as st
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(50, 20), columns=(“col %d” % i for i in range(20)))

ddd2 = st.dataframe(df) # Same as st.write(df)

ddd = pd.DataFrame(st.dataframe(ddd2)) # not working
ddd = pd.DataFrame(st.dataframe(ddd2[“data”])) # not working
ddd = pd.DataFrame(st.dataframe(ddd2[“data”]).value()) # not working

ddd2.tolist() # not working

st.dataframe does not return a dataframe. st.dataframe is just a command to display a dataframe. If you have st.dataframe(df), then df is your dataframe. You don’t need to pass it through a display command to use it. Just keep working with df.