Spaces:
No application file
No application file
| import streamlit as st | |
| import pandas as pd | |
| st.set_page_config(page_title="Illinois Data Insights Dashboard", layout="wide") | |
| st.title("Illinois Data Insights Dashboard") | |
| # Load your uploaded data file | |
| df = pd.read_csv("Illinois_Entire_Data_Insights_Final_v2.csv") | |
| st.subheader("Preview of Data") | |
| st.write(df.head()) | |
| # Select a column for the bar chart (example: 'status') | |
| column_for_bar = st.selectbox( | |
| "Select a column to visualize as a bar chart (categorical columns work best):", | |
| [ | |
| "status", "committee", "Category & Subcategory", "Legislative Goal", | |
| "Policy Impact Areas", "Stance", "Intent", "Motivation" | |
| ] | |
| ) | |
| # Create a simple bar chart: count of each value in the selected column | |
| if column_for_bar in df.columns: | |
| st.subheader(f"Bar Chart: Count of {column_for_bar}") | |
| chart_data = df[column_for_bar].value_counts().reset_index() | |
| chart_data.columns = [column_for_bar, "Count"] | |
| st.bar_chart(chart_data.set_index(column_for_bar)) | |
| else: | |
| st.warning("Selected column not found in data.") | |
| st.markdown("---") | |
| st.caption("Customize this dashboard further to fit your needs!") | |