I’ve all the time been a fan of the styler methodology in pandas. Once I began constructing Streamlit apps, it was clear to me that I needed to model my dataframes to assist in visualising dataframes, however… shock! As of the time of writing, Streamlit st.dataframe() doesn’t assist styler objects, solely dataframe objects. Nicely, correction, it does assist them, however the UI show is horrendous!
That is why I need to share with you my workarounds and concepts to constructing a well-styled dataframe in Streamlit. We are going to cowl:
- The best way to add commas for separating 1000’s in numbers.
- The best way to show a quantity as a share (from 0.24 within the knowledge to 24% within the UI)
- The best way to add foreign money symbols.
- The best way to add color to the cells. Even higher, I’ll share with you my favorite colour-grading perform.
- The best way to add emojis! Sure, we cant reside with out emojis 😊!
Streamlit is definitely fairly good at inferring the most effective show based mostly on knowledge sorts. Think about the…