Python data analysis libraries

Updated Nov 2026

Python data analysis libraries load tables of data and filter, join, group, and summarize them. These libraries prepare the data behind reports, dashboards, and machine learning models.

Popularity

pandas has the most monthly downloads in this comparison, at 688.5M.

LibraryMonthly downloadsStarsLast releaseLicense
pandas
706.0M
49.6KNov 2026BSD-3-Clause
pyarrow
435.9M
17.3KNov 2026Apache-2.0
DuckDB
80.0M
207Oct 2026MIT
Polars
68.0M
40.4KOct 2026MIT
PySpark
48.4M
44.6KOct 2026Apache-2.0
Dask
31.5M
14.0KAug 2026BSD-3-Clause
xarray
12.9M
4.2KSep 2026Apache-2.0
Ibis
3.6M
6.7KFeb 2026Apache-2.0
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

pandas holds tabular data in a DataFrame, a table of labeled columns that can each hold a different type, such as text, numbers, or dates. Operations run as soon as they are called and keep the whole table in memory. The library aligns rows by label in arithmetic, groups data for split-apply-combine operations, and marks missing values as NaN, NA, or NaT. Readers and writers cover CSV files, Excel files, and SQL databases.

Downloads / mo
706.0M
Stars
49.6K
Last release
3.1.1
License
BSD-3-Clause

Strengths

  • Stores mixed-type table columns. Organize named columns containing text, numbers, and other supported data types.
  • Processes suitable workloads in chunks. Split supported workflows into chunks that each fit in memory.

Limitations

  • Data must fit in memory. Each operation loads its data into RAM. Larger datasets need chunked reading or another engine, such as Dask or Polars.
  • Parallel work needs numba. Parallel column-wise computation runs only through the optional numba engine.

Quickstart

From pandas.DataFrame.html
$ pip install pandas
import pandas as pd

d = {"col1": [1, 2], "col2": [3, 4]}
df = pd.DataFrame(data=d)
print(df)

pandas examples

From open-source projects on GitHub

PyArrow is the Python library for Apache Arrow, a columnar memory format for tabular data. pa.table builds a typed, column-oriented table from arrays, and the library converts to and from pandas and NumPy. Polars and DuckDB read Arrow data directly, so a table can pass between them without a copy. Its Acero engine and dataset scanner run deferred queries over collections of files.

Downloads / mo
435.9M
Stars
17.3K
Last release
26.0.1
License
Apache-2.0

Strengths

  • Shared column format. Polars, DuckDB, and pandas exchange data through Arrow tables instead of converting row by row.

Limitations

  • Windows wheels need a runtime. Importing the pip wheels on Windows can require the latest Visual C++ Redistributable.

Quickstart

From pyarrow.table.html
$ pip install pyarrow
import pyarrow as pa
n_legs = pa.array([2, 4, 5, 100])
animals = pa.array(["Flamingo", "Horse", "Brittle stars", "Centipede"])
names = ["n_legs", "animals"]
pa.table({"n_legs": n_legs, "animals": animals})

pyarrow examples

From open-source projects on GitHub

DuckDB is an analytical SQL database that runs inside the Python process, with no server and no external dependencies. duckdb.sql runs a query and returns a relation, and a query can name a pandas DataFrame or an Arrow table in its FROM clause as if it were a database table. DuckDB reads and writes CSV, Parquet, and JSON files, locally or in remote storage buckets, and processes workloads larger than memory.

Downloads / mo
80.0M
Stars
207
Last release
2.0.0
License
MIT

Strengths

  • Queries pandas dataframes directly. Run SQL against pandas DataFrames without importing them into database tables.
  • Spills larger workloads to disk. Process eligible larger-than-memory queries using temporary disk storage.

Limitations

  • Some aggregates stay in memory. Aggregate states that cannot spill to disk must fit in available memory.
  • Relations rerun on access. A relation runs its query again each time it is read. Materializing the result avoids the repeat work.

Quickstart

From overview.html
$ pip install duckdb
import duckdb

duckdb.sql("SELECT 42").show()

DuckDB examples

From open-source projects on GitHub

Polars is a dataframe query engine written in Rust. Queries go through its expression API, through SQL, or through both, and share one optimizer. Functions such as pl.scan_parquet start a lazy query that runs at collect, after Polars has optimized it, with execution spread across all CPU cores. Operations that exceed RAM can spill to disk, and data passes to other tools in the Arrow format without copying.

Downloads / mo
68.0M
Stars
40.4K
Last release
2.1.0
License
MIT

Strengths

  • Defers work until collection. Build a lazy plan, then execute it when collecting the result.
  • Parallelizes native dataframe expressions. Run eligible expressions and grouped computations across CPU threads.

Limitations

  • Streaming falls back to memory. Operations the streaming engine does not support run on the in-memory engine instead.
  • SQL trails expressions. New features reach the expression API before the SQL interface.

Quickstart

From getting-started.md
$ pip install polars
import polars as pl
import datetime as dt

df = pl.DataFrame(
    {
        "name": ["Alice Archer", "Ben Brown", "Chloe Cooper", "Daniel Donovan"],
        "birthdate": [
            dt.date(1997, 1, 10),
            dt.date(1985, 2, 15),
            dt.date(1983, 3, 22),
            dt.date(1981, 4, 30),
        ],
        "weight": [57.9, 72.5, 53.6, 83.1],  # (kg)
        "height": [1.56, 1.77, 1.65, 1.75],  # (m)
    }
)

print(df)

Polars examples

From open-source projects on GitHub

PySpark is the Python API for Apache Spark, an engine for large-scale data processing. A SparkSession creates DataFrames, and transformations on them build a plan that runs when an action such as show or collect asks for results. Spark SQL queries the same DataFrames, and the pandas API on Spark accepts pandas-style code. The pyspark package bundles Spark's JAR files for local development or for connecting to an existing cluster.

Downloads / mo
48.4M
Stars
44.6K
Last release
4.3.0
License
Apache-2.0

Strengths

  • One engine for SQL and DataFrames. Spark SQL and the DataFrame API share an execution engine and query the same registered views.

Limitations

  • Cluster setup is separate. The package runs Spark locally or connects to an existing cluster. A new standalone cluster needs the full Spark distribution.

Quickstart

From quickstart_df.html
$ pip install pyspark
from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()

from datetime import datetime, date
from pyspark.sql import Row

df = spark.createDataFrame([
    Row(a=1, b=2., c='string1', d=date(2000, 1, 1), e=datetime(2000, 1, 1, 12, 0)),
    Row(a=2, b=3., c='string2', d=date(2000, 2, 1), e=datetime(2000, 1, 2, 12, 0)),
    Row(a=4, b=5., c='string3', d=date(2000, 3, 1), e=datetime(2000, 1, 3, 12, 0))
])
df

df.show()

PySpark examples

From open-source projects on GitHub

Dask is a parallel computing library that splits pandas dataframes and NumPy arrays into partitions and runs operations on them as a task graph. dd.from_pandas turns a pandas DataFrame into a Dask DataFrame, and calls such as mean() add to the graph without running it until compute(). The same graph runs on threads, on processes, or on a distributed cluster.

Downloads / mo
31.5M
Stars
14.0K
Last release
2026.8.0
License
BSD-3-Clause

Strengths

  • Partitions familiar pandas dataframes. Process tabular data through coordinated pandas partitions.
  • Scales across a computer cluster. Run partitioned analysis on one machine or a distributed cluster.

Limitations

  • Threads share the interpreter lock. Python-heavy code runs one thread at a time. The process or distributed scheduler runs that code in parallel.
  • Shuffles move data. Joining or regrouping by a new key moves rows between many partitions.

Quickstart

From Ten minutes to Dask
$ python -m pip install "dask[dataframe]"
import numpy as np
import pandas as pd
import dask.dataframe as dd

index = pd.date_range("2021-09-01", periods=2400, freq="1h")
df = pd.DataFrame({"a": np.arange(2400), "b": list("abcaddbe" * 300)}, index=index)
ddf = dd.from_pandas(df, npartitions=10)
ddf

ddf.a.mean()
ddf.a.mean().compute()

Dask examples

From open-source projects on GitHub

xarray adds labels, in the form of named dimensions, coordinates, and attributes, to NumPy-like arrays with any number of dimensions. Operations take dimension names instead of axis positions, as in x.sum('time'), and selection works by label. The data model comes from netCDF files, which xarray reads and writes, and Dask can back the arrays for parallel and out-of-memory work.

Downloads / mo
12.9M
Stars
4.2K
Last release
2026.9.0
License
Apache-2.0

Strengths

  • Named dimensions. Code refers to dimensions such as time or latitude by name, independent of axis order.

Limitations

  • Queries without SQL. Selection runs through Python and pandas expressions. SQL needs a conversion to a dataframe first.

Quickstart

From quick-overview.rst
$ pip install xarray
import numpy as np
import pandas as pd
import xarray as xr

data = xr.DataArray(np.random.randn(2, 3), dims=("x", "y"), coords={"x": [10, 20]})
data

xarray examples

From open-source projects on GitHub

Ibis is a dataframe library that builds lazy expressions and compiles them for a separate backend to run, DuckDB by default. The same API covers more than twenty backends, so code written against a local file can move to a remote database by changing the connection. ibis.connect opens a backend, and Table.sql mixes SQL into a table expression.

Downloads / mo
3.6M
Stars
6.7K
Last release
12.0.0
License
Apache-2.0

Strengths

  • One API, many backends. The same dataframe code runs on DuckDB, Polars, PySpark, Snowflake, BigQuery, PostgreSQL, and other backends.
  • Dataframes and SQL together. Dataframe expressions and SQL strings compose in one query.

Limitations

  • Backend support varies. Each backend implements its own set of operations and its own SQL dialect.

Quickstart

From basics.qmd
$ pip install 'ibis-framework[duckdb,examples]'
import ibis

con = ibis.connect("duckdb://penguins.ddb")
con.create_table(
    "penguins", ibis.examples.penguins.fetch().to_pyarrow(), overwrite=True
)

Ibis examples

From open-source projects on GitHub

FAQ

pandas handles tables that fit in memory, with each operation running as soon as it is called. Polars and DuckDB run larger queries on one machine, Polars through a dataframe API and DuckDB through SQL. PySpark and Dask spread the work across a cluster.

pandas runs each operation immediately and keeps the table in memory. Polars can build a lazy query, optimize it, and run it across all CPU cores, and operations that exceed RAM can spill to disk. Polars stores data in the Apache Arrow format, which it shares with other tools without copying.

pandas runs on one machine and holds the data in memory. PySpark sends the work to Spark, which plans transformations and runs them when an action such as show or collect asks for results, on a local machine or a cluster.

Ibis is a dataframe library that builds lazy expressions and runs them on a separate backend, DuckDB by default. The same code runs on more than twenty backends, so moving from a laptop to a remote database means changing the connection.

Both run analytical queries inside the Python process and can handle data larger than memory. DuckDB is a SQL database that queries pandas and Arrow data directly, while Polars centers on a dataframe expression API and also accepts SQL.

Dask splits pandas dataframes and NumPy arrays into partitions and schedules them from Python, on one machine or a cluster. Spark is a separate engine that PySpark drives, with DataFrames and SQL sharing one planner.

For coding agents

Found your data analysis library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official