Need help with presentation of data

I want to print a dictionary(containing several dataframes in it) in my app. Since I didn’t know about which st syntax to use so I used st.dataframe(dictionary) and I got the below error message.

StreamlitAPIException : Unable to convert object of type <class 'dict'> to pandas.DataFrame.

Though, my output is printed but not so beautiful. It has headers and it’s column values misaligned. How can I align column names and values properly and app output isn’t utilizing the full web page. Some intermediate columns were hidden too. Need help with presentation of data.

Hi @puneet_rajput30,

It’s hard to help without seeing exactly what’s in your data structure, but I have a guess that the contents of the dictionary are not uniformly convertible to dataframes.

You might want to try breaking the dictionary contents into different parts and displaying them separately. E.g. if your dictionary looks something like this:

{ "df1": <dataframe>,
  "df2": <dataframe>,
  "df3": <dataframe>,
 }

…then try doing this:

st.dataframe[data["df1"])
st.dataframe[data["df2"])
st.dataframe[data["df3"])

You can also try simply using st.write(data) and just see what happens. :slight_smile:

Thanks for trying out Streamlit!