window-ops
Implementations of window operations such as rolling and expanding.
What it is and what it does
window-ops wraps numba-compiled functions to compute rolling, expanding, and seasonal window statistics on numpy arrays. It targets the same operations as pandas rolling and expanding methods but trades pandas' flexibility for raw speed on numeric arrays. The library includes both batch transformations (returning an array of the same length as the input) and online classes that maintain state and emit one result per update, useful for streaming or incremental scenarios.
The package depends on numba and numpy; numba's JIT compilation happens at first call. It supports Python 3.6 through 3.10 and is permissively licensed under Apache 2.0. Maintenance is dormant—the last release was in March 2024 and the repository shows no recent activity—so it is stable for existing use cases but will not receive new features or active bug fixes.
Use it for:
- Accelerate batch computation of rolling means, max, min, or std on large numeric arrays where pandas is too slow.
- Implement streaming window statistics by using online classes (RollingMean, ExpandingMax, etc.) to update results as new samples arrive.
- Compute seasonal rolling or expanding operations (e.g., 7-day rolling statistics with a seasonal period) on time-series data.
- Replace pandas rolling/expanding calls in performance-critical loops where the overhead of pandas indexing is unacceptable.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides numba-optimized window operations (rolling, expanding, seasonal) on numpy arrays as a faster alternative to pandas rolling and expanding methods, plus online classes for incremental updates.
Yes, if you have a specific performance bottleneck with rolling or expanding operations on numpy arrays and can tolerate dormant maintenance. The library is stable, permissively licensed, and offers substantial speedups (4x to 78x in the published benchmarks) for its narrow use case. Not recommended if you need active development, broad window function coverage, or integration with pandas DataFrames.
Install
window-ops on PyPI
pip
pip install window-opsuv
uv add window-opspoetry
poetry add window-opsInstalling window-ops
Before you install
Low install friction with just two runtime dependencies (numba and numpy). Maintenance is dormant—last commit was 2024-06-02 and no release in over 893 days—so expect no active bug fixes or feature development, though the codebase is stable enough for established use cases.
License in practice
Apache Software License 2.0 is permissive, allowing commercial and private use with minimal restrictions; you must include a copy of the license and state any modifications.
Quickstart
pip install window-ops
import numpy as np
from window_ops import rolling_mean
arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
result = rolling_mean(arr, window_size=2)
Verify before relying
- Whether numba's JIT compilation overhead is acceptable for your use case's array sizes and call patterns.
- Compatibility with newer numpy/numba versions beyond the last tested release date.
Package facts
| License | Apache Software License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numba, numpy |
| Maintenance | dormant — 893 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 215,813/month — #9,393 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: window_ops-0.0.15-py3-none-any.whl
Keywords: rolling, expanding
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
floxFlox provides fast GroupBy reduction operations…
permissive · top 15,000 on PyPI
BottleneckBottleneck provides fast NumPy array functions…
permissive · top 5,000 on PyPI
mapplyProvides a lightweight, customizable multi-core…
permissive · top 15,000 on PyPI
coreforecastProvides fast C++ implementations of…
permissive · top 5,000 on PyPI
dbl-tempoTempo provides time series operations on Spark…
permissive · top 5,000 on PyPI
crickCrick provides approximate and streaming…
permissive · top 15,000 on PyPI
tbatsImplements BATS and TBATS exponential smoothing…
permissive · top 15,000 on PyPI
stockstatsAdds technical analysis indicators and…
permissive · top 15,000 on PyPI
awkward-pandasExtends pandas DataFrames to store and…
permissive · top 15,000 on PyPI
numpy-groupiesProvides optimized group-indexing operations on…
permissive · top 15,000 on PyPI