create a pandas dataframe with a some id as index
To upload files, please first save the app
import streamlit as st
import pandas as pd
import numpy as np
# Create sample data with ID as index
data = {
'Name': ['John', 'Alice', 'Bob', 'Carol', 'Dave'],
'Age': [25, 30, 35, 28, 42],
'City': ['New York', 'San Francisco', 'Chicago', 'Boston', 'Seattle'],
'Salary': [50000, 75000, 60000, 65000, 80000]
}
# Create DataFrame with custom index
df = pd.DataFrame(data, index=['ID001', 'ID002', 'ID003', 'ID004', 'ID005'])
# Display the DataFrame
st.write("DataFrame with ID Index:")
st.dataframe(df)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?