
Lego Price Explorer
by marimo team
Explore price differences across Lego themes and analyze price-per-piece patterns.
About this notebook
This notebook compares the prices of Lego sets across themes. It loads a CSV of Lego sets with Polars and keeps sets that have a US retail price and come from a theme with at least ten sets. Altair draws the filtered sets as a scatter plot, one point per set, colored by theme.
You select up to five themes with a multiselect widget. Range sliders filter the sets by year, price, and price per piece. Two dropdowns choose which columns appear on the chart axes, from year, pieces, price, and price per piece. One checkbox adds a LOESS trend line per theme, and another scales the prices with an assumed inflation rate of three percent per year. Stat tiles above the chart show the average price per piece for each selected theme, and they update with every filter change.
marimo wraps the Altair chart in a selection widget. Select points in the chart, and marimo re-runs the cell that depends on the selection. That cell shows the id, name, theme, and image URL of each selected set as a data table.











