Hide dataframe columns

I have a dataframe with many columns, how to hide some in data editor?

I found a workaround:
st.dataframe(styled_df, hide_index=True, column_config={"B": None}) hides the column.

It works.

1 Like

Hi @zbjdonald

You could also use column_order parameter in st.dataframe (st.dataframe - Streamlit Docs) and st.data_editor (https://docs.streamlit.io/library/api-reference/data/st.data_editor)

For example, specifying those columns that you want to show (all others would be hidden):

column_order=("col2", "col1")

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.