hampel
Python implementation of the Hampel Filter
Decision gist · record as of 2026-08-14
Yes, if you need robust outlier detection for time-series data and can tolerate dormant maintenance. The package is stable, has no known vulnerabilities, and MIT licensing poses no risk. However, verify that breaking changes in version 1.0.1 do not affect your use case, and be aware that numpy and pandas are substantial dependencies. Not recommended if you need active maintenance or frequent updates.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.8 and numpy and pandas as runtime dependencies.
- High install friction: the package depends on numpy and pandas, which are substantial dependencies.
- Maintenance is dormant—last release was 1060 days ago (2023-09-19), with the last commit in 2024-02-06.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use it freely in commercial and private projects with minimal restrictions.
last release 2023-09-19 (1060 days) · last repo commit 2024-02-06 · 67 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 228,454 downloads/mo, #9,153 on PyPI
Alternatives
Verify before relying
pip install hampel
import pandas as pd
from hampel import hampel
data = pd.Series([1.0, 2.0, 3.0, 100.0, 4.0, 5.0, 6.0])
result = hampel(data, window_size=3, n_sigma=3.0)
print(result.filtered_data)- Whether breaking changes in version 1.0.1 affect common use patterns or are edge-case only.
- Performance characteristics on large datasets or high-dimensional data.
- Whether the dormant maintenance status indicates the library is stable or at risk of incompatibility with future pandas/numpy versions.
What it is and what it does
Hampel is a Python implementation of the Hampel filter, a statistical method for detecting and removing outliers in time-series data. It uses a sliding window approach, computing the Median Absolute Deviation (MAD) for each window and flagging observations that deviate from the median by more than a configurable threshold (n_sigma). Outliers are then replaced with the window's median value.
The package works with pandas Series and numpy arrays, and returns a Result object containing the filtered data, outlier indices, medians, MAD values, and thresholds. It is designed for cleaning noisy time-series before analysis or modeling, and integrates naturally with pandas workflows via the apply method on DataFrames.
Use it for
- Clean sensor or measurement data before feeding it to a machine learning model.
- Detect and remove spikes in financial time-series (stock prices, trading volumes).
- Preprocess IoT or monitoring data to identify equipment anomalies or sensor faults.
- Prepare time-series datasets for statistical analysis or forecasting by removing outliers.
- Identify and flag unusual events in log or event-stream data for further investigation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need robust outlier detection for time-series data and can tolerate dormant maintenance.
The package is stable, has no known vulnerabilities, and MIT licensing poses no risk. However, verify that breaking changes in version 1.0.1 do not affect your use case, and be aware that numpy and pandas are substantial dependencies. Not recommended if you need active maintenance or frequent updates.
Install
hampel on PyPI
Before you install
High install friction: the package depends on numpy and pandas, which are substantial dependencies. Maintenance is dormant—last release was 1060 days ago (2023-09-19), with the last commit in 2024-02-06. Breaking changes were introduced in version 1.0.1, so upgrading requires code review.
Requires Python >= 3.8 and numpy and pandas as runtime dependencies.
License in practice
Licensed under MIT (permissive), so you can use it freely in commercial and private projects with minimal restrictions.
Quickstart
pip install hampel
import pandas as pd
from hampel import hampel
data = pd.Series([1.0, 2.0, 3.0, 100.0, 4.0, 5.0, 6.0])
result = hampel(data, window_size=3, n_sigma=3.0)
print(result.filtered_data)
Verify before relying
- Whether breaking changes in version 1.0.1 affect common use patterns or are edge-case only.
- Performance characteristics on large datasets or high-dimensional data.
- Whether the dormant maintenance status indicates the library is stable or at risk of incompatibility with future pandas/numpy versions.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | High. Source build required |
| Runtime dependencies | 2 packagesnumpypandas |
| Maintenance | Dormant 1,060 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 228,454 / month, #9,153 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: hampel-1.0.2.tar.gz
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 › “hampel filter implementation”
- hampelHampel detects and filters outliers in time-series data by comparing…
- eth-bloomImplements Ethereum's bloom filter algorithm for efficient membership…
- bloom-filter2A pure Python implementation of a Bloom filter—a probabilistic data…
Give your agent the search over MCP, or paste the wish link into any chat.
More Information Analysis packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyarrow provides Python bindings to Apache Arrow's C++ libraries for efficient columnar data processing, serialization, and interoperability with pandas, NumPy, and other Python ecosystem tools.
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
Snowpark Python provides APIs to query and process data directly in Snowflake without moving data to your local system, with support for both native Snowpark and pandas-compatible interfaces.
Install it if you use Snowflake and want to process data without moving it to your application layer.
See also u8darts · darts · pyod · alibi-detect · stockstats · datasieve · adtk · prophet · semhash · anomalo