This commit is contained in:
2026-01-23 15:05:35 +01:00
parent 0f5ecf5ac7
commit 393c527656

View File

@@ -103,9 +103,38 @@ def _(mo):
return
@app.cell(hide_code=True)
def _(data_all, mo):
data_all_collected = data_all.collect()
ages = mo.ui.multiselect(options=data_all_collected["QID1"], value=data_all_collected["QID1"].unique(), label="Select Age Group(s):")
income = mo.ui.multiselect(data_all_collected["QID15"], value=data_all_collected["QID15"], label="Select Income Group(s):")
gender = mo.ui.multiselect(data_all_collected["QID2"], value=data_all_collected["QID2"], label="Select Gender(s)")
ethnicity = mo.ui.multiselect(data_all_collected["QID3"], value=data_all_collected["QID3"], label="Select Ethnicities:")
consumer = mo.ui.multiselect(data_all_collected["Consumer"], value=data_all_collected["Consumer"], label="Select Consumer Groups:")
mo.md(f"""
# Data Filters
{ages}
{gender}
{ethnicity}
{income}
{consumer}
""")
return ages, consumer, ethnicity, gender, income
@app.cell
def _(data_all, survey):
data = survey.filter_data(data_all, age=None, gender=None, income=None, ethnicity=None, consumer=None)
def _(ages, consumer, data_all, ethnicity, gender, income, survey):
data = survey.filter_data(data_all, age=ages.value, gender=gender.value, income=income.value, ethnicity=ethnicity.value, consumer=consumer.value)
data.collect()
return (data,)