marimo makes you more productive when working with dataframes, the most common Python tool for interacting with data.

marimo integrates with Pandas and Polars dataframes natively. The examples on this page use Pandas, but Polars works too.

Displaying dataframes#

You can display dataframes directly in the output area of a cell, by including them in the last expression of the cell:

A raw dataframe output
import pandas as pd

df = pd.read_json(

Rich displays. You can display dataframes in rich tables or charts using the mo.ui.table or mo.ui.altair_chart elements.

Rich, interactive displays
import marimo as mo
import altair as alt
import pandas as pd

df = pd.read_json(
)[["Horsepower", "Miles_per_Gallon", "Origin"]]

            .encode(x="Horsepower", y="Miles_per_Gallon", color="Origin")

Selecting dataframes#

Select data in a table or Plotly/Altair plot, and your selection is automatically sent to Python as a Pandas dataframe.

Select rows in a table, get them back as a dataframe
# Cell 1 - display a dataframe
import marimo as mo
import pandas as pd

df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
table = mo.ui.table(df, selection="multi")
# Cell 2 - display the selection

Transforming dataframes#

No-code transformations#

Use mo.ui.dataframe to interactively transform a dataframe with a GUI, no coding required!. When you’re done, you can copy the code that the GUI generated for you and paste it into your notebook.

Build transformations using a GUI
# Cell 1
import marimo as mo
import pandas as pd

df = pd.DataFrame({"person": ["Alice", "Bob", "Charlie"], "age": [20, 30, 40]})
transformed_df = mo.ui.dataframe(df)
# Cell 2
# transformed_df.value holds the transformed dataframe
Copy the code of the transformation

Custom filters#

Create custom filters with marimo UI elements, like sliders and dropdowns.

# Cell 1 - create a dataframe
df = pd.DataFrame({"person": ["Alice", "Bob", "Charlie"], "age": [20, 30, 40]})
# Cell 2 - create a filter
age_filter = mo.ui.slider(start=0, stop=100, value=50, label="Max age")
# Cell 3 - display the transformed dataframe
filtered_df = df[df["age"] < age_filter.value]

Polars support#

marimo also supports Polars, a modern, faster alternative to Pandas.


Check out a full example here, or run it yourself:

marimo edit