Hi! I have a problem with the code below. It only filters the st.radio and then when selecting the st.selectboxes the dataframe appears in white only the header. I don’t know where the error is. Whether it’s code or editor configuration. I use VSCode.
df = pd.read_csv(r"C:\Users\...data.csv", sep=";")
with st.sidebar:
product_list = list(df["Product"].unique())
product = st.radio(label="SELECT THE PRODUCT", options=product_list)
region_list = list(df["Region"].unique())
region = st.selectbox(label="SELECT THE REGION", options=region_list)
state_list = list(df["State"].unique())
state = st.selectbox(label="SELECT THE STATE", options=state_list)
city_list = list(df["City"].unique())
city = st.selectbox(label="SELECT THE CITY", options=city_list)
reset_filter = st.sidebar.button("RESET FILTERS") #not finished yet
query = f"Product =='{product}' & Region =='{region}' & State =='{state}' & City =='{city}'"
df_filter = df.query(query)
st.write(df_filter)