Is there a way to show two st.dataframes in the same row, kind of like using the make_subplots(rows=1, cols=2) for plots ?
Thanks in advance.
Is there a way to show two st.dataframes in the same row, kind of like using the make_subplots(rows=1, cols=2) for plots ?
Thanks in advance.
Hi @gtheodorou, welcome to the Streamlit community!!
Yes! You can use st.beta_columns
to create two columns and then display a unique dataframe in each column. Here’s an example: Say you have two dataframes df1
and df2
:
# create two columns of equal width
col1, col1 = st.beta_columns(2)
with col1:
st.dataframe(df1) # display df1 in first column
with col2:
st.dataframe(df2) # display df2 in second column
Checkout out our API reference and blog post to learn more about how to layout your app
Happy Streamlit’ing!
Snehan
Thanks a lot @snehankekre, could I do something like this to show above the st.dataframe a plot ?
# create two columns of equal width
col1, col1 = st.beta_columns(2)
with col1:
st.plotly_chart(createChart1())
st.dataframe(df1) # display df1 in first column
with col2:
st.plotly_chart(createChart2())
st.dataframe(df2) # display df2 in second column
Yup! It shouldn’t be an issue
Best,
Snehan
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.