Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Text gets truncated while using streamlit.write(df)

I’m using the function streamlit.write(df) to display a df, but the text is not fully displayed, here is a short example of the situation.

import pandas as pd
import streamlit as st

df = pd.DataFrame({'col1': [1, 2, 3], 'col2': ['This is some text large text that will not be 
                  completely displayed, need to add break lines or something.', 'short text', 
                  'another piece of text.']})
st.write(df))

This is the output, the ideal thing is to add line breaks, but did not work for me.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use table

st.table(df)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading