Integration with Python packages and language features
This section outlines a range of integrations that the DuckDB Python client has across both Python language features and other Python packages that are commonly used in the Python data ecosystem. Note that all the integrations outlined here are applicable to both the Relational API and the DB-API.
Querying Python data structures
In addition to being able to query DuckDB relation objects, DuckDB is able to query directly from pandas Dataframes, Polars Dataframes, and Arrow tables. This means that you can treat objects of these types as if they were tables in your DuckDB database when constructing queries.
There are at least three distinct ways you can go about doing this. All of them work against pandas Dataframes, Polars Dataframes, and Arrow tables, as well as DuckDB relation objects. We’ll demonstrate each of these three methods using a pandas dataframe that we’ll create with pandas’ read_parquet...