Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

A thumbnail showing a Pillow image being resized and cropped, with coordinate boxes and rotation arrows.
Python

Python Pillow: Open, Save, Resize, Crop, and Rotate Images

Learn how to open, save, resize, crop, and rotate images with Python Pillow. Covers core Image methods, EXIF orientation, and common pitfalls.

PillowImage ProcessingPython ImagingPIL
Diagram comparing DuckDB, pandas, and polars execution models for Python data processing
Python

python duckdb vs pandas vs polars: How to Choose

Compare python duckdb vs pandas vs polars by execution model, memory behavior, and API design to choose the right tool for your data workload.

duckdbpandaspolarsdataframes
Illustration comparing DuckDB and SQLite as two embedded database options for Python, with columnar and row-oriented storage layouts.
Python

Python DuckDB vs SQLite: Which Embedded Database to Use

Compare DuckDB and SQLite for Python: storage layout, query performance, data types, concurrency, and external data support to choose the right embedded database.

DuckDBSQLiteembedded databasesdata analysis
Illustration of a Python dataframe being registered into a DuckDB database for SQL querying.
Python

Python DuckDB Register Dataframe: Syntax and Examples

Learn how to register a Pandas or Polars dataframe in DuckDB with Python for SQL querying, including syntax, how the registration behaves, and performance tradeoffs.

DuckDBPandasDataframeSQL
A diagram showing multiple data tables being joined and aggregated inside a DuckDB engine connected to Python.
Python

Python DuckDB: SQL Joins, Aggregation, and Analytics

Learn how to use DuckDB's SQL engine in Python for joins, GROUP BY aggregations, FILTER clauses, window functions, and parameterized analytical queries.

DuckDBSQLData AnalysisPandas
Illustration of Python code connecting to both an in-memory DuckDB instance and a persistent DuckDB file on disk, showing the two modes side by side.
Python

Python DuckDB: In-Memory and Persistent Databases

Learn how to create and use DuckDB in-memory and persistent databases in Python, including connection setup, behavioral differences, and how to choose the right mode.

DuckDBIn-Memory DatabasePersistent DatabasePython SQL
Illustration of DuckDB connecting pandas and Polars DataFrames through an Arrow-based interchange layer.
Python

Integrating DuckDB with pandas and Polars in Python

Use DuckDB SQL to query pandas and Polars DataFrames directly, join across both engines, and move data between formats without unnecessary copies.

duckdbpandaspolarspython
Illustration of DuckDB querying a CSV file, a Parquet file, and a Pandas DataFrame simultaneously, with SQL arrows connecting them.
Python

Query CSV, Parquet, and DataFrames with DuckDB in Python

Use DuckDB in Python to run SQL queries directly on CSV, Parquet, and Pandas DataFrames. This guide covers core query patterns, combining sources, and performance tradeoffs.

DuckDBPythonParquetCSV
Side-by-side illustration of PyArrow's columnar memory layout and pandas' row-column DataFrame structure, highlighting their different data representations.
Python

Python PyArrow vs Pandas: A Practical Comparison

python pyarrow vs pandas: Compare Python PyArrow and pandas for data processing: memory layout, API differences, performance tradeoffs, and when to use each.

PyArrowPandasData ProcessingPerformance
A pandas DataFrame with a PyArrow arrow symbol representing the backend integration, emphasizing speed and memory efficiency.
Python

pandas PyArrow Backend: A Practical Guide

Learn how to enable the pandas PyArrow backend, understand the data type changes, and decide when it improves performance and memory use.

pandaspyarrowdataframeperformance