Spaces:
Runtime error
Runtime error
File size: 759 Bytes
9c2b84d |
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 |
import streamlit as st
import pandas as pd
df = pd.read_csv("dummy_data.csv")
st.title("🌍 CGD Survey Explorer (PoC)")
st.sidebar.header("🔎 Filter Questions")
selected_country = st.sidebar.selectbox("Select Country", sorted(df["Country"].unique()))
selected_year = st.sidebar.selectbox("Select Year", sorted(df["Year"].unique()))
keyword = st.sidebar.text_input("Keyword Search", "")
filtered = df[
(df["Country"] == selected_country) &
(df["Year"] == selected_year) &
(df["Question"].str.contains(keyword, case=False, na=False))
]
st.markdown(f"### Results for **{selected_country}** in **{selected_year}**")
st.dataframe(filtered[["Variable", "Question", "Responses"]])
if filtered.empty:
st.info("No matching questions found.")
|