Install & Compatibility
Where this runs
tested against v0.2.2 · 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
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 13.1s · import 16.216s · 458MB
466MB installed
● package 466MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
app_entropy
✓ from antropy import app_entropy
sample_entropy
✓ from antropy import sample_entropy
perm_entropy
✓ from antropy import perm_entropy
spectral_entropy
✓ from antropy import spectral_entropy
detrended_fluctuation
✓ from antropy import detrended_fluctuation
katz_fd
✓ from antropy import katz_fd
petrosian_fd
✓ from antropy import petrosian_fd
higuchi_fd
✓ from antropy import higuchi_fd
lz_complexity
✓ from antropy import lz_complexity
Compute sample entropy, permutation entropy, and Higuchi fractal dimension on a random 1D array.
import numpy as np
from antropy import sample_entropy, perm_entropy, higuchi_fd
# Generate a random time series
np.random.seed(42)
x = np.random.rand(100)
# Sample entropy
se = sample_entropy(x)
print(f"Sample entropy: {se:.4f}")
# Permutation entropy with order 3
pe = perm_entropy(x, order=3)
print(f"Permutation entropy: {pe:.4f}")
# Higuchi fractal dimension
hfd = higuchi_fd(x)
print(f"Higuchi fractal dimension: {hfd:.4f}")
Errors
Common errors & fixes
ValueError: md must be an integer >=2
Passing a fractional or too small embedding dimension to sample_entropy or app_entropy.
fixEnsure the 'dim' parameter (often 'm') is an integer >= 2, e.g., m=2.
ValueError: tolerance (r) must be positive
Passing a non-positive tolerance to sample_entropy or app_entropy.
fixSet r to a positive float, typically 0.2 * standard deviation of the signal.
RuntimeError: Numba jit compilation failed. Falling back to pure Python.
Numba version incompatibility or missing LLVM. Antropy uses numba for acceleration, but falls back gracefully.
fixInstall compatible numba version: pip install 'numba>=0.57' or ignore if performance is acceptable.
AttributeError: module 'antropy' has no attribute 'petrosian_fd'
Older version of antropy (<0.1.5) did not include petrosian_fd, or function was renamed.
fixUpgrade to latest version: pip install --upgrade antropy
Upgrade
Version history
0.2.2latest on PyPI · released Apr 1, 2026
Audit
Dependencies
numpyrequiredCore numerical operations
scipyrequiredSignal processing and statistical functions
scikit-learnrequiredUsed for KDTree in sample entropy
numbaoptionalOptional JIT acceleration for sample entropy and LZ complexity