Problem displaying dataframe with st.table

I want to display a dataframe with st.table but I get the error “Dataframe dimensions don’t align” when the index doesn’t increment by 1.

A trivial example that doesn’t work:

my_table = pd.DataFrame({“A”:range(1,121,1)},index=range(1,241,2))

Note that st.text(my_table) does work ok or making the index increment by 1 also works. I can also display the dataframe with no problem in a Jupyter Notebook.

Debug info

  • Streamlit version: 0.87.0
  • Python version: 3.6.2
  • OS version: Red Hat Enterprise Linux Workstation 7.9
  • Browser version: Firefox 102.3.0esr

Your code works for me with Streamlit 1.15.2 and 1.16.0. You are likely being hit by a bug that was fixed in a later version.

Thanks very much, that’s good to know. Will see if I can get the latest version installed.