Process multi-channel data with N-D arrays
masterMany AntroPy functions accept N-D arrays and an axis argument, allowing you to process multi-channel data (e.g., EEG/ECG) in a single call. Specify the axis along which the time-series is defined (commonly axis=-1).
import numpy as np
import antropy as ant
# 4 channels × 3000 samples
X = np.random.normal(size=(4, 3000))
pe = ant.perm_entropy(X, normalize=True, axis=-1) # shape (4,)
mob, com = ant.hjorth_params(X, sf=256, axis=-1) # shape (4,) each
zc = ant.num_zerocross(X, normalize=True, axis=-1) # shape (4,)
se = ant.spectral_entropy(X, sf=256, normalize=True) # shape (4,)