Skip to content
Discussion options

You must be logged in to vote

Does this work for you? https://marimo.app/l/b1c5pn

import marimo

__generated_with = "0.19.6"
app = marimo.App(width="medium")


@app.cell
def _():
    import marimo as mo
    import pandas as pd
    return mo, pd


@app.cell
def _(pd):
    data = {
        "a" : [1,2,3,1,2,3],
        "b" : [4,4,5,5,6,6],
    }
    df = pd.DataFrame(data=data)
    df
    return (df,)


@app.cell
def _(df, mo):
    options_a = df["a"].drop_duplicates()
    options_b = df["b"].drop_duplicates()

    select_a = mo.ui.multiselect(options=options_a, value=options_a, label="a")
    return select_a, select_b


@app.cell
def _(df, select_a, select_b):
    filtered_options_b = df[df["a"].isin(select_a.value)]["b"].

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dmadisetti
Comment options

@depley
Comment options

Answer selected by depley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants