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.
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
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.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
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.