I’ve at all times been a fan of the styler technique in pandas. After I began constructing Streamlit apps, it was clear to me that I wished to model my dataframes to help in visualising dataframes, however… shock! As of the time of writing, Streamlit st.dataframe() doesn’t assist styler objects, solely dataframe objects. Effectively, correction, it does assist them, however the UI show is horrendous!
Because of this I wish to share with you my workarounds and concepts to constructing a well-styled dataframe in Streamlit. We’ll cowl:
- Tips on how to add commas for separating 1000’s in numbers.
- Tips on how to show a quantity as a proportion (from 0.24 within the information to 24% within the UI)
- Tips on how to add foreign money symbols.
- Tips on how to add color to the cells. Even higher, I’ll share with you my favorite colour-grading operate.
- Tips on how to add emojis! Sure, we cant reside with out emojis 😊!
Streamlit is definitely fairly good at inferring one of the best show primarily based on information varieties. Think about the…