tjl8/Legislative_Analysis
0
1import streamlit as st2import pandas as pd3import matplotlib.pyplot as plt4import os5 6st.title("Basic Bar Chart from Legislative Data")7 8DATA_PATH = "Illinois_Entire_Data_Insights_Final_v2.csv"9 10if not os.path.exists(DATA_PATH):11 st.error(f"Data file {DATA_PATH} not found in repo.")12 st.stop()13 14df = pd.read_csv(DATA_PATH)15st.success(f"Loaded {DATA_PATH}")16 17# For example: count of bills by 'intent_standardized'18if 'intent_standardized' not in df.columns:19 st.error("Column 'intent_standardized' not found in data.")20 st.stop()21 22counts = df['intent_standardized'].value_counts()23 24st.write("### Count of Bills by Intent")25 26fig, ax = plt.subplots()27counts.plot(kind='bar', ax=ax)28ax.set_xlabel("Intent")29ax.set_ylabel("Count")30plt.xticks(rotation=45)31 32st.pyplot(fig)33 