According to the documentation a dataframe is supposed to be sorted when the title is clicked. However when I used st.dataframe(df)
the table seems static. I am using chrome in a desktop and latest streamlit.
The previous answer is not true at all.
@Hanan_Shteingart
You are right, the documentation says this:
https://docs.streamlit.io/library/api-reference/data/st.dataframe#interactivity
And if i test this with this simple example, it worked:
import streamlit as st
import pandas as pd
st.title('Dataframe Test')
df = pd.util.testing.makeMixedDataFrame()
st.text(df.dtypes)
st.dataframe(df)
Which streamlit version are you using?
I immediately had the same suspicion. A new user in the forum who registers and immediately begins to answer several questions. Partially even wrong answers. Would a normal user probably rather not do.
Column sorting is activated as default for all columns in st.dataframe
. But make sure that you are using a recent Streamlit version and not have legacy serialization activated. Column sorting also gets deactivated for large tables (>150k rows). The reason is that sorting at this size significantly impacts the performance since everything happens in-browser.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.