create a data frame with fake columns: a string and a number, then use pandas style to left align the numbers
To upload files, please first save the app
import pandas as pd
# Create a DataFrame with fake data
data = {
'Category': ['A', 'B', 'C', 'D', 'E'],
'Values': [10, 15, 20, 25, 30]
}
data_df = pd.DataFrame(data)
# Left align the numbers in the 'Values' column using pandas style
styled_df = data_df.style.set_properties(**{'text-align': 'left'}, subset=['Values'])
import streamlit as st
st.title('Left Align Numbers DataFrame')
st.dataframe(styled_df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?