a table from dataframe and allows user to edit values
Drop files here
or click to upload
import streamlit as st
import pandas as pd
# Sample data
initial_data = {
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [24, 30, 22],
'City': ['New York', 'Los Angeles', 'Chicago']
}
df = pd.DataFrame(initial_data)
# Editable DataFrame
edited_df = st.data_editor(
df,
column_config={
'Name': 'Full Name',
'Age': st.column_config.NumberColumn('Age (Years)', min_value=0),
'City': 'City'
}
)
st.write('Updated DataFrame')
st.table(edited_df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?