Bottleneck
Fast NumPy array functions written in C
Decision gist · record as of 2026-08-14
Yes, if you work with NumPy arrays and frequently call NaN-aware or moving-window operations on large datasets. The permissive license and active maintenance make it low-risk. Install friction is medium due to compiled extensions, but binary wheels cover most platforms. Skip it if your arrays are small, you rarely use these specific functions, or you work exclusively with non-numeric dtypes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires NumPy 1.16.0 or later; Python 3.10 or newer for current binary wheels.
- Medium install friction due to compiled C extensions; however, binary wheels are available for common platforms (Python 3.10–3.12 on Linux, macOS, Windows), making installation straightforward in most environments.
- The package is actively maintained with a recent release.
License · maintenance · safety
Simplified BSD (permissive) — Distributed under a Simplified BSD license (permissive), allowing use in commercial and private projects with minimal restrictions.
last release 2025-09-08 (340 days) · last repo commit 2026-08-09 · 1,181 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,889,451 downloads/mo, #1,428 on PyPI
Alternatives
Verify before relying
pip install bottleneck
import bottleneck as bn
import numpy as np
a = np.array([1, 2, np.nan, 4, 5])
result = bn.nanmean(a) # Returns 3.0- Actual performance gains vary by array size, dtype, and operation—the description shows benchmark ratios but real-world speedup depends on your specific use case.
What it is and what it does
Bottleneck is a C-accelerated library that reimplements common NumPy array operations to run significantly faster, particularly when working with NaN values or performing moving-window calculations. It wraps NumPy arrays and provides drop-in replacements for functions like nanmean, nansum, nanstd, nanmin, nanmax, median, and a suite of moving-window operations (move_mean, move_sum, move_std, move_median, etc.).
The package is designed for workflows where you repeatedly call these operations on large arrays—finance, time-series analysis, and scientific computing are typical use cases. It only accelerates int32, int64, float32, and float64 dtypes; other dtypes fall back to slower unaccelerated paths. Installation is straightforward on common platforms thanks to pre-built binary wheels, though it requires a C compiler if building from source.
Use it for
- Computing statistics on financial time series with missing data (NaN values) where speed matters.
- Calculating rolling/moving averages, sums, and standard deviations on large arrays.
- Finding min/max and ranking operations on arrays with NaN values faster than NumPy.
- Accelerating scientific data processing pipelines that repeatedly call reduction functions.
- Replacing slow NumPy operations in data analysis workflows without changing code logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with NumPy arrays and frequently call NaN-aware or moving-window operations on large datasets.
The permissive license and active maintenance make it low-risk. Install friction is medium due to compiled extensions, but binary wheels cover most platforms. Skip it if your arrays are small, you rarely use these specific functions, or you work exclusively with non-numeric dtypes.
Install
bottleneck on PyPI
Before you install
Medium install friction due to compiled C extensions; however, binary wheels are available for common platforms (Python 3.10–3.12 on Linux, macOS, Windows), making installation straightforward in most environments. The package is actively maintained with a recent release.
Requires NumPy 1.16.0 or later; Python 3.10 or newer for current binary wheels.
License in practice
Distributed under a Simplified BSD license (permissive), allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install bottleneck
import bottleneck as bn
import numpy as np
a = np.array([1, 2, np.nan, 4, 5])
result = bn.nanmean(a) # Returns 3.0
Verify before relying
- Actual performance gains vary by array size, dtype, and operation—the description shows benchmark ratios but real-world speedup depends on your specific use case.
Package facts
| License | Simplified BSD permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 340 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,889,451 / month, #1,428 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: Financial and Insurance IndustryIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 2 - BetaTopic :: Scientific/Engineering |
Evidence: bottleneck-1.6.0-cp310-cp310-macosx_11_0_arm64.whl; bottleneck-1.6.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; bottleneck-1.6.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bottleneck-1.6.0-cp310-cp310-musllinux_1_2_aarch64.whl; bottleneck-1.6.0-cp310-cp310-musllinux_1_2_x86_64.whl; bottleneck-1.6.0-cp310-cp310-win32.whl; bottleneck-1.6.0-cp310-cp310-win_amd64.whl; bottleneck-1.6.0-cp311-cp311-macosx_11_0_arm64.whl; bottleneck-1.6.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; bottleneck-1.6.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bottleneck-1.6.0-cp311-cp311-musllinux_1_2_aarch64.whl; bottleneck-1.6.0-cp311-cp311-musllinux_1_2_x86_64.whl; bottleneck-1.6.0-cp311-cp311-win32.whl; bottleneck-1.6.0-cp311-cp311-win_amd64.whl; bottleneck-1.6.0-cp312-cp312-macosx_11_0_arm64.whl; bottleneck-1.6.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; bottleneck-1.6.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bottleneck-1.6.0-cp312-cp312-musllinux_1_2_aarch64.whl; bottleneck-1.6.0-cp312-cp312-musllinux_1_2_x86_64.whl; bottleneck-1.6.0-cp312-cp312-win32.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “nan-aware array functions”
- BottleneckBottleneck provides fast NumPy array functions written in C,…
- numpy-groupiesProvides optimized group-indexing operations on arrays, with…
- array-api-extraProvides extra array manipulation functions that work across any…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also numbagg · window-ops · numpy-groupies · antropy · albucore · jenkspy · fast-array-utils · numexpr · numpy-minmax · sparse