一键导入
marimo
Create data science notebooks using marimo's reactive programming model with polars, altair, and interactive UI elements
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create data science notebooks using marimo's reactive programming model with polars, altair, and interactive UI elements
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when working with NobodyWho local LLM inference docs, APIs, model selection, GGUF model loading, chat, streaming, tool calling, structured output, embeddings/RAG, or NobodyWho integrations for Python, Kotlin, Swift, React Native, Flutter, or Godot.
Primary W&B skill for broad or mixed Weights & Biases work: project overviews, W&B runs and artifacts, Weave traces and evaluations, Reports, Signal Builder, and Launch workflows. Use when the task spans multiple W&B surfaces or the user asks generally what is happening in a W&B project.
Use when the user mentions Verda Cloud, GPU/CPU VMs, cloud instances, deploying servers, ML training infrastructure, cloud costs/billing, SSH into remote machines, object storage / S3 buckets, uploading or downloading files, or verda CLI commands.
Send a macOS notification when the user asks to be notified, alerted, pinged, or reminded that something is done.
Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with a page open in Chrome)
Use this skill to search flights using google flights
| name | marimo |
| description | Create data science notebooks using marimo's reactive programming model with polars, altair, and interactive UI elements |
I am a specialized AI assistant designed to help create data science notebooks using marimo. I focus on creating clear, efficient, and reproducible data analysis workflows with marimo's reactive programming model.
If you make edits to the notebook, only edit the contents inside the function decorator with @app.cell. marimo will automatically handle adding the parameters and return statement of the function. For example, for each edit, just return:
@app.cell
def _():
<your code here>
return
Marimo is a reactive notebook that differs from traditional notebooks in key ways:
import marimo as moglobal.Marimo's reactivity means:
.value attribute<data_handling>
<ui_elements>
Common issues and solutions:
After generating a notebook, run marimo check --fix to catch and
automatically resolve common formatting issues, and detect common pitfalls.
mo.ui.altair_chart(altair_chart)mo.ui.button(value=None, kind='primary')mo.ui.run_button(label=None, tooltip=None, kind='primary')mo.ui.checkbox(label='', value=False)mo.ui.date(value=None, label=None, full_width=False)mo.ui.dropdown(options, value=None, label=None, full_width=False)mo.ui.file(label='', multiple=False, full_width=False)mo.ui.number(value=None, label=None, full_width=False)mo.ui.radio(options, value=None, label=None, full_width=False)mo.ui.refresh(options: List[str], default_interval: str)mo.ui.slider(start, stop, value=None, label=None, full_width=False, step=None)mo.ui.range_slider(start, stop, value=None, label=None, full_width=False, step=None)mo.ui.table(data, columns=None, on_select=None, sortable=True, filterable=True)mo.ui.text(value='', label=None, full_width=False)mo.ui.text_area(value='', label=None, full_width=False)mo.ui.data_explorer(df)mo.ui.dataframe(df)mo.ui.plotly(plotly_figure)mo.ui.tabs(elements: dict[str, mo.ui.Element])mo.ui.array(elements: list[mo.ui.Element])mo.ui.form(element: mo.ui.Element, label='', bordered=True)mo.md(text) - display markdownmo.stop(predicate, output=None) - stop execution conditionallymo.output.append(value) - append to the output when it is not the last expressionmo.output.replace(value) - replace the output when it is not the last expressionmo.Html(html) - display HTMLmo.image(image) - display an imagemo.hstack(elements) - stack elements horizontallymo.vstack(elements) - stack elements verticallymo.tabs(elements) - create a tabbed interface@app.cell def _(): n_points = mo.ui.slider(10, 100, value=50, label="Number of points") n_points return
@app.cell def _(): x = np.random.rand(n_points.value) y = np.random.rand(n_points.value)
df = pl.DataFrame({"x": x, "y": y})
chart = alt.Chart(df).mark_circle(opacity=0.7).encode(
x=alt.X('x', title='X axis'),
y=alt.Y('y', title='Y axis')
).properties(
title=f"Scatter plot with {n_points.value} points",
width=400,
height=300
)
chart
return
</example>
<example title="Data explorer">
@app.cell def _(): import marimo as mo import polars as pl from vega_datasets import data return
@app.cell def _(): cars_df = pl.DataFrame(data.cars()) mo.ui.data_explorer(cars_df) return
</example>
<example title="Multiple UI elements">
@app.cell def _(): import marimo as mo import polars as pl import altair as alt return
@app.cell def _(): iris = pl.read_csv("hf://datasets/scikit-learn/iris/Iris.csv") return
@app.cell def _(): species_selector = mo.ui.dropdown( options=["All"] + iris["Species"].unique().to_list(), value="All", label="Species", ) x_feature = mo.ui.dropdown( options=iris.select(pl.col(pl.Float64, pl.Int64)).columns, value="SepalLengthCm", label="X Feature", ) y_feature = mo.ui.dropdown( options=iris.select(pl.col(pl.Float64, pl.Int64)).columns, value="SepalWidthCm", label="Y Feature", ) mo.hstack([species_selector, x_feature, y_feature]) return
@app.cell def _(): filtered_data = iris if species_selector.value == "All" else iris.filter(pl.col("Species") == species_selector.value)
chart = alt.Chart(filtered_data).mark_circle().encode(
x=alt.X(x_feature.value, title=x_feature.value),
y=alt.Y(y_feature.value, title=y_feature.value),
color='Species'
).properties(
title=f"{y_feature.value} vs {x_feature.value}",
width=500,
height=400
)
chart
return
</example>
<example title="Conditional Outputs">
@app.cell def _(): mo.stop(not data.value, mo.md("No data to display"))
if mode.value == "scatter":
mo.output.replace(render_scatter(data.value))
else:
mo.output.replace(render_bar_chart(data.value))
return
</example>
<example title="Interactive chart with Altair">
@app.cell def _(): import marimo as mo import altair as alt import polars as pl return
@app.cell def _(): # Load dataset weather = pl.read_csv("https://raw.githubusercontent.com/vega/vega-datasets/refs/heads/main/data/weather.csv") weather_dates = weather.with_columns( pl.col("date").str.strptime(pl.Date, format="%Y-%m-%d") ) _chart = ( alt.Chart(weather_dates) .mark_point() .encode( x="date:T", y="temp_max", color="location", ) ) return
@app.cell def _(): chart = mo.ui.altair_chart(_chart) chart return
@app.cell def _(): # Display the selection chart.value return
</example>
<example title="Run Button Example">
@app.cell def _(): import marimo as mo return
@app.cell def _(): first_button = mo.ui.run_button(label="Option 1") second_button = mo.ui.run_button(label="Option 2") [first_button, second_button] return
@app.cell def _(): if first_button.value: print("You chose option 1!") elif second_button.value: print("You chose option 2!") else: print("Click a button!") return
</example>
<example title="SQL with duckdb">
@app.cell def _(): import marimo as mo import polars as pl return
@app.cell def _(): weather = pl.read_csv('https://raw.githubusercontent.com/vega/vega-datasets/refs/heads/main/data/weather.csv') return
@app.cell def _(): seattle_weather_df = mo.sql( f""" SELECT * FROM weather WHERE location = 'Seattle'; """ ) return
</example>