entroscope
every entropy measure for time series data, in one consistent API
A Python library with seven entropy measures for time-series data, all sharing one consistent interface with rolling windows, delta tracking, normalization, and built-in charts.
Entroscope is a Python library that gives you seven different ways to measure entropy in a sequence of numbers over time, all through a single consistent interface. Entropy, in this context, is a way to quantify how random or predictable a data series is. The library was originally built to analyze food search interest trends: when a food's entropy falls, it means the search pattern is becoming more structured, which can signal that the item is about to go mainstream.
The library works directly with pandas Series and numpy arrays. You install it with pip and then import individual measures by name. Each measure exposes the same set of methods: compute returns a single number, rolling applies the measure over a sliding window, delta tracks the rate of change, normalized scales the result to a 0-to-1 range, and plot returns a chart. Switching from one entropy measure to another is a one-word change in your code.
The seven measures cover different aspects of data behavior. Shannon entropy captures how spread out a distribution is. Permutation entropy looks at the order of values and is resistant to noise. Sample and Approximate entropy both assess how predictable or regular a series is. Spectral entropy describes how the power of a signal is distributed across frequencies. Differential entropy handles continuous distributions. Multiscale entropy applies the sample measure across multiple time scales.
The library also includes visualization tools. You can overlay several measures on one chart for comparison, display a dashboard of all measures at once, or highlight moments where entropy drops sharply, which can indicate a trend or regime change. All plot functions return a matplotlib figure without displaying it, so they work equally well in scripts, notebooks, and automated pipelines.
Example scripts in the repository cover food-trend detection, financial market analysis, medical time series like heart rate variability and EEG data, and business metrics like sales demand and web traffic. Python 3.9 or later is required, with numpy, pandas, scipy, and matplotlib installed automatically.
Where it fits
- Detect when a food or fashion trend is about to go mainstream by tracking drops in entropy over time in search interest data
- Analyze heart rate variability or EEG time series using sample entropy and multiscale entropy measures
- Compare seven entropy measures on the same financial dataset to find which signal best predicts regime changes
- Flag anomalies in sales or web-traffic data when entropy drops sharply in an automated pipeline