Skip to content

Lempel–Ziv analysis
for NumPy arrays.

Discretize continuous signals, calculate complexity and entropy, and compare sequences along any array axis.

pip install lzsuite

Python 3.10+ NumPy MIT license

An oscillating float signal and its binary labels after thresholding at the mean. An oscillating float signal and its binary labels after thresholding at the mean.
import numpy as np
import lzsuite as lzs

rng = np.random.default_rng(42)
data = rng.normal(size=(2000, 4, 3))

entropy = lzs.h(data, axis=0)
entropy.shape  # (4, 3)
2,000 samples × 4 channels × 3 trials12 sequences, one result per channel and trial.

Numerical examples

All examples
Entropy density and effective measure complexity for six binary sequences.Entropy density and effective measure complexity for six binary sequences.

Entropy and effective measure complexity

Compare constant, periodic, persistent, and independent sequences. Inspect estimator choice and sequence-length dependence.

Normalized information distances among eight periodic sequences, noisy variants, and independent sequences.Normalized information distances among eight periodic sequences, noisy variants, and independent sequences.

Pairwise information distance

Compare sequences in a collection and corresponding pairs across arrays. Examine matrix ordering and finite-length self-distances.

Documentation

Usage guides, function signatures, result conventions, and reproducible figure source.

Numerical calculations are provided by lzcomplexity. lzsuite adds array handling, discretization, and process-level parallelism.