numbagg
Fast N-dimensional aggregation functions with Numba
What it is and what it does
Numbagg is a library of fast aggregation and moving-window functions for N-dimensional NumPy arrays, written in Numba and exposed as generalized ufuncs. It includes standard reductions (nansum, nanmean, nanstd, nanvar), grouping operations (group_nansum, group_nanmean, etc.), moving-window statistics (move_mean, move_std, move_corr), and fill operations (ffill, bfill). The library is designed to outperform pandas and NumPy on multi-core systems through Numba's JIT compilation and parallelization, though single-threaded performance is comparable to NumPy and the first call to any function incurs JIT overhead.
It targets scientific and data-analysis workflows where performance on large arrays matters and flexible axis handling across many dimensions is needed. The main trade-off is that functions are JIT-compiled on first use, so initial calls are slower; subsequent calls are fast. Dependencies are minimal (numpy and numba), and the package supports Python 3.10 and later.
Use it for:
- Compute moving averages and standard deviations on time-series data with NaN handling faster than pandas.
- Apply grouped aggregations (sum, mean, count) on multi-dimensional scientific data.
- Calculate rolling correlations and covariances on financial or climate datasets.
- Forward-fill or backward-fill missing values in large arrays with better performance than pandas.
- Parallelize custom reductions across multiple cores on arrays too large for pure NumPy.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Numbagg provides fast N-dimensional aggregation and moving-window functions compiled with Numba, including reductions (nansum, nanmean, nanstd), grouping operations, and forward/backward fill, optimized for multi-core parallelization.
Yes. Numbagg is worth installing if you work with large N-dimensional NumPy arrays and need fast aggregations or moving-window functions, especially on multi-core systems. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. The JIT compilation overhead on first call is a minor drawback but typical for Numba-based libraries and acceptable for most scientific workflows.
Install
numbagg on PyPI
pip
pip install numbagguv
uv add numbaggpoetry
poetry add numbaggInstalling numbagg
Before you install
Low install friction with a pure Python wheel and only two runtime dependencies (numpy and numba). Actively maintained with a recent release and no known vulnerabilities.
License in practice
BSD 3-Clause license with portions from Bottleneck (Simplified BSD). Permissive for commercial and private use; requires attribution and license notice in redistributions.
Quickstart
import numbagg
import numpy as np
arr = np.array([1.0, 2.0, np.nan, 4.0])
result = numbagg.nansum(arr)
# or for moving window:
window_result = numbagg.move_mean(arr, window=2)
Requires Python 3.10 or later. First execution of any function triggers JIT compilation, which adds startup latency.
Verify before relying
- Whether all listed functions (move_corr, group_nansum, etc.) are fully stable or still experimental.
- Exact memory overhead of JIT compilation relative to raw numpy for small arrays.
- Whether axis parameter behavior is documented for >3 dimensions in current release.
Package facts
| License | License ======= Numbagg is distributed under a BSD 3-clause license. It includes portions of Bottleneck, which is distributed under a Simplified BSD license. Numbagg license =============== BSD… (full text in the JSON record) (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, numba |
| Maintenance | actively maintained — 242 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 974,005/month — #4,601 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: numbagg-0.9.4-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
BottleneckBottleneck provides fast NumPy array functions…
permissive · top 5,000 on PyPI
numbaNumba is a just-in-time compiler that…
permissive · top 1,000 on PyPI
sparseProvides multi-dimensional sparse array data…
permissive · top 5,000 on PyPI
numpy-groupiesProvides optimized group-indexing operations on…
permissive · top 15,000 on PyPI
fast-array-utilsConverts and computes statistics across sparse,…
copyleft · top 15,000 on PyPI
mapplyProvides a lightweight, customizable multi-core…
permissive · top 15,000 on PyPI
pandarallelPandarallel parallelizes pandas DataFrame…
permissive · top 15,000 on PyPI
acvl-utilsProvides utility functions for dynamic…
permissive · top 15,000 on PyPI
dask-imageDistributed image processing using Dask,…
permissive · top 15,000 on PyPI