Registry / data / stumpy

stumpy

JSON →
library1.14.1pypypi✓ verified 35d ago

STUMPY is a powerful and scalable Python library that efficiently computes the matrix profile, a novel data structure for time series analysis. This allows for a variety of time series data mining tasks such as pattern/motif discovery, anomaly detection, semantic segmentation, and more. It is currently at version 1.14.1 and maintains an active development cycle with regular releases.

dataai-ml
Install & Compatibility
Where this runs
tested against v1.14.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 10.8s · import 5.588s · 411MB
412MB installed
● package 412MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Standard import for the library.

import stumpy

Often used in conjunction with stumpy for array manipulation and data generation.

import numpy as np

This quickstart demonstrates how to compute the matrix profile for a 1-dimensional time series using the `stumpy.stump` function. The `m` parameter specifies the window size for subsequences. The output `matrix_profile` array contains crucial information about each subsequence's nearest neighbor.

import stumpy import numpy as np # Generate a random time series your_time_series = np.random.rand(1000) # Define a window size (m) for subsequences window_size = 50 # Compute the matrix profile matrix_profile = stumpy.stump(your_time_series, m=window_size) print(f"Matrix Profile shape: {matrix_profile.shape}") # The matrix_profile array contains 4 columns: # 0: Nearest neighbor distance (matrix profile value) # 1: Nearest neighbor index # 2: Left nearest neighbor index # 3: Right nearest neighbor index
Debug
Known footguns
breakingPython Version Requirement: STUMPY requires Python 3.10 or newer. Users on older Python versions (e.g., 3.9 or earlier) will encounter installation or runtime errors.
gotchaWindow Size (m) Selection: Choosing an appropriate window size (`m`) for `stumpy.stump` is critical. An ill-chosen `m` can lead to uninformative or misleading matrix profiles. The optimal `m` is highly dependent on the nature of your time series and the patterns you are looking for.
gotchaUnderstanding Matrix Profile Output: The `stumpy.stump` function returns a NumPy array with four specific columns: `[distance, index, left_index, right_index]`. Misinterpreting these columns, especially the 'index' (nearest neighbor) versus 'left_index'/'right_index' (directional nearest neighbors), is a common footgun.
gotchaGPU Acceleration Requires NVIDIA and CUDA: While STUMPY supports GPU acceleration (e.g., with `stumpy.gpu_stump`), this functionality relies on Numba's CUDA JIT compiler. This means you need an NVIDIA GPU and the appropriate CUDA Toolkit installed on your system; simply installing STUMPY will not automatically provide GPU capabilities.
deprecatedNumPy Version Adherence to NEP 29: STUMPY follows NEP 29 (NumPy Enhancement Proposal 29) for its supported Python and NumPy versions. This means that older NumPy versions will eventually be dropped from support without specific breaking changes from STUMPY itself, but due to upstream dependency policy.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
39 hits · last 30 days
oai-searchbot
8
chatgpt-user
6
ahrefsbot
4
amazonbot
4
bytedance
2
script
1
bingbot
1
mj12bot
1
Resources