Ibis dataframes

Dataframe code that compiles to SQL: GeoPandas-style spatial work run by DuckDB, and the places the translation leaks.

Three chained Ibis methods compiled into one SQL query that DuckDB runs, returning 167 rows. dataframe methods in, one SQL query out.filter(cafés).join(suburbs, within).group_by(…).aggregate(…)nothing is read yetSELECT … ST_WITHIN(…) … GROUP BY 1 → DuckDBIbis writes the SQL; DuckDB streams the files and returns only the result rows

Ibis lets you write the filters, joins and group-bys of a GeoPandas script as dataframe methods and have DuckDB run them as one SQL query. Nothing is read until you ask for a result, and the rows never pass through Python on the way: counting 623,445 Auckland buildings into their suburbs peaked at 442 MB this way, against 1,521 MB in GeoPandas, for the same answer.

The translation is not seamless for spatial work. On Ibis 12 and DuckDB 1.5 the built-in readers fail on GeoParquet, the geometry column carries no CRS, some documented methods do not compile, and a distance means whatever unit the coordinates are in. Every guide here was run on the same Overture Maps extract of Auckland, and each of those problems has its own fix page with the error it raises.

🧭 Start with the concepts

The ideas the how-to guides below assume you already have.

⚙️ Then do the task

Step-by-step walkthroughs with code you can copy and adapt.

🔧 When it breaks

The errors this topic produces, with the cause explained rather than just the command.

Related topics

Subjects that keep coming up alongside this one, most overlap first.

Keep browsing

Ibis dataframes sits in Tools. Every topic on the site is listed on the topics index.