Spaces:
Sleeping
Sleeping
File size: 1,169 Bytes
511b495 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
import streamlit as st
import pandas as pd
# Load data from a CSV file
csv_file = 'Bengaluru_House_Data.csv' # Replace with your CSV file path
df = pd.read_csv(csv_file)
# Set the title of the web app
st.title("CSV Data Table and Select Boxes Example")
# Define the options for the select boxes
options1 = ["Low", "Medium", "High"]
options2 = ["Option A", "Option B", "Option C"]
options3 = ["Choice X", "Choice Y", "Choice Z"]
# Create the select boxes
growth = st.selectbox("Growth", options1, index=0)
income = st.selectbox("Income", options2, index=0)
budget = st.selectbox("Budget", options3, index=0)
# Function to handle selection changes
st.write(f"Selected Growth: {growth}")
st.write(f"Selected Income: {income}")
st.write(f"Selected Budget: {budget}")
# Display the dataframe as a table
st.dataframe(df)
# Optionally, you can add some styling
st.markdown("""
<style>
.stDataFrame {
border: 2px solid black;
}
.stDataFrame thead th {
background-color: lightblue;
font-weight: bold;
color: black;
}
.stDataFrame tbody td {
border: 1px solid black;
}
</style>
""", unsafe_allow_html=True)
|