---
title: "An introduction to Ibis"
description: "Ibis is an open-source Python dataframe library that compiles lazy, composable relational expressions to SQL and runs them on 20+ backends, including ClickHouse."
url: "https://swe.quest/articles/an-introduction-to-ibis-8a6a34b40efccef2"
canonical: "https://clickhouse.com/blog/introduction-to-ibis"
source: "ClickHouse"
published: "2024-08-05"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["python","analytics","sql"]
---

# An introduction to Ibis

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-08-05, 8 min read, How-to. Original: [https://clickhouse.com/blog/introduction-to-ibis](https://clickhouse.com/blog/introduction-to-ibis)

## Summary

Ibis is an open-source Python dataframe library that compiles lazy, composable relational expressions to SQL and runs them on 20+ backends, including ClickHouse. The walkthrough loads the nycflights13 dataset into a local ClickHouse server and covers casting columns without altering the stored schema, grouping and aggregating with agg and topk, inspecting generated SQL with ibis.to\_sql, and composing stored expressions with filter, union and argmin/argmax. It ends by querying an existing remote table on the ClickHouse Playground. The generated SQL works but nests more subqueries than hand-written SQL would.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Python](https://swe.quest/tags/python.md) (Languages)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- Python basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- SQL aggregation ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- dataframe concepts

## Keywords

Ibis, ClickHouse, ClickHouse Playground, nycflights13

## Related posts

- [Querying Pandas DataFrames with ClickHouse](https://swe.quest/articles/querying-pandas-dataframes-with-clickhouse-f6443dd364e0e7c9.md): ClickHouse · 2023-11-15 · Medium · 4 min read · Python, Analytics & OLAP, SQL
  chDB, an embedded Python library built on the ClickHouse engine, can run SQL directly against Pandas DataFrames through the chdb.dataframe module.
- [Welcome, chDB](https://swe.quest/articles/welcome-chdb-80fea87c647d8ab8.md): ClickHouse · 2023-08-31 · Medium · 7 min read · Analytics & OLAP, Python, Databases, Open source
  chDB is a community-built embedded SQL OLAP engine that packages ClickHouse as an in-process Python module, similar in spirit to DuckDB, for local analytics, ETL and exploration without running a server.
- [ClickHouse and Power BI, columnar end to end: the Arrow Flight connector is in public preview](https://swe.quest/articles/clickhouse-and-power-bi-columnar-end-to-end-the-arrow-flight-connector-is-in-319079df226af9e9.md): ClickHouse · 2026-11-19 · Medium · 7 min read · Analytics & OLAP, Networking, Performance engineering
  ClickHouse's new Power BI connector, now in public preview, talks Arrow Flight SQL over TLS-encrypted gRPC.
- [Retail data, reimagined: How Increff rebuilt its BI platform with ClickHouse](https://swe.quest/articles/retail-data-reimagined-how-increff-rebuilt-its-bi-platform-with-clickhouse-9614303cc823e283.md): ClickHouse · 2025-01-14 · Medium · 4 min read · Analytics & OLAP, Databases, Performance engineering
  Increff, a retail SaaS provider for brands like Puma and Adidas, replaced a BI stack of Pandas transformations, a serverless SQL warehouse and Superset after a client with 5x larger data caused query slowdowns and concurrency limits.
- [Announcing chDB 4: write Pandas, run ClickHouse, now on Hex](https://swe.quest/articles/announcing-chdb-4-write-pandas-run-clickhouse-now-on-hex-3e3042b3b93d1f1e.md): ClickHouse · 2026-03-11 · Medium · 11 min read · Analytics & OLAP, Query engines, Python, Performance engineering
  chDB 4 adds DataStore, a Pandas-compatible API that records operations lazily as a chain of LazyOps, then compiles them into ClickHouse SQL with filter pushdown, column pruning and limit propagation, executing in-process on the ClickHouse engine.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
