Install & Compatibility
Where this runs
tested against v2.1.8 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.6s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
WaveletMatrix
✓ from wavelet_matrix import WaveletMatrix
✗ from waveletmatrix import WaveletMatrix
Hyphen in package name, underscore in import module name.
Basic usage: create a WaveletMatrix from a list of integers, then use rank, select, and quantile methods.
from wavelet_matrix import WaveletMatrix
data = [5, 3, 1, 4, 2]
wm = WaveletMatrix(data)
print(wm.rank(3, 2)) # rank of value 3 up to index 2
print(wm.select(1, 1)) # position of the 1st occurrence of value 1
print(wm.quantile(0, 4, 2)) # 2nd smallest in range [0,4]
Errors
Common errors & fixes
AttributeError: module 'wavelet_matrix' has no attribute 'WaveletMatrix'
Importing using the package name with hyphen instead of underscore.
fixUse `from wavelet_matrix import WaveletMatrix` (note underscore).
TypeError: WaveletMatrix.__init__() got multiple values for argument 'data'
Passing the old second argument (alphabet_size) to constructor.
fixCall `WaveletMatrix(data)` without alphabet size. The class now infers alphabet automatically.
ValueError: Rank query index out of range
Passing an index >= length of the sequence.
fixEnsure index < len(wavelet_matrix). Rank indices are 0-based up to n-1.
Upgrade
Version history
2.1.8latest on PyPI · released Mar 16, 2026
Audit
Dependencies
No dependency data recorded yet.