skillfed

window-ops

Implementations of window operations such as rolling and expanding.

window-ops v0.0.15 215.8K downloads/30d#9,393 on PyPI44
Permissive license Apache Software License 2.0 DORMANT released

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-ops

uv

uv add window-ops

poetry

poetry add window-ops

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

rolling window operations numpyexpanding window statisticsnumba optimized rolling meanfast window aggregationsseasonal rolling operationsonline window statisticsnumpy array windowing
performance-optimizationtime-seriesnumba-jit

More Mathematics packages