I’ve all the time been a fan of the styler technique in pandas. Once I began constructing Streamlit apps, it was clear to me that I needed to type my dataframes to help in visualising dataframes, however… shock! As of the time of writing, Streamlit st.dataframe() doesn’t help styler objects, solely dataframe objects. Effectively, correction, it does help them, however the UI show is horrendous!
For this reason I need to share with you my workarounds and concepts to constructing a well-styled dataframe in Streamlit. We are going to cowl:
- How one can add commas for separating 1000’s in numbers.
- How one can show a quantity as a share (from 0.24 within the information to 24% within the UI)
- How one can add forex symbols.
- How one can add color to the cells. Even higher, I’ll share with you my favorite colour-grading perform.
- How one can add emojis! Sure, we cant stay with out emojis 😊!
Streamlit is definitely fairly good at inferring the most effective show primarily based on information varieties. Think about the…