Spaces:
Runtime error
Runtime error
Download app.py from tjl8/Legislative_Analysis: direct link, hf CLI and curl.
- Browser
- Download file 779 Bytes
-
https://huggingface.co/spaces/tjl8/Legislative_Analysis/resolve/main/app.py
- Command line
-
hf download hf://spaces/tjl8/Legislative_Analysis/app.py
-
curl -L -o app.py https://huggingface.co/spaces/tjl8/Legislative_Analysis/resolve/main/app.py
779 Bytes
| import streamlit as st | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import os | |
| st.title("Basic Bar Chart from Legislative Data") | |
| DATA_PATH = "Illinois_Entire_Data_Insights_Final_v2.csv" | |
| if not os.path.exists(DATA_PATH): | |
| st.error(f"Data file {DATA_PATH} not found in repo.") | |
| st.stop() | |
| df = pd.read_csv(DATA_PATH) | |
| st.success(f"Loaded {DATA_PATH}") | |
| # For example: count of bills by 'intent_standardized' | |
| if 'intent_standardized' not in df.columns: | |
| st.error("Column 'intent_standardized' not found in data.") | |
| st.stop() | |
| counts = df['intent_standardized'].value_counts() | |
| st.write("### Count of Bills by Intent") | |
| fig, ax = plt.subplots() | |
| counts.plot(kind='bar', ax=ax) | |
| ax.set_xlabel("Intent") | |
| ax.set_ylabel("Count") | |
| plt.xticks(rotation=45) | |
| st.pyplot(fig) | |