Skip to main content

The definitive entropy toolkit for time series data

Project description

entroscope

CI

The definitive entropy toolkit for time series data.

pip install entroscope and get every entropy measure you'd ever need, with one consistent interface that works directly on pandas Series and numpy arrays.

Born from NextOnMenu, where Shannon entropy of food-trend search interest had to be computed by hand. entroscope makes that a one-liner.

Install

pip install entroscope

Quick start

import pandas as pd
from entroscope import shannon

s = pd.Series([10, 20, 15, 80, 90, 85, 88, 92])
shannon.compute(s)              # single entropy value
shannon.rolling(s, window=20)   # rolling entropy over time
shannon.delta(s, window=20)     # rate of change
shannon.plot(s, window=20)      # matplotlib Figure

Measures

shannon · permutation · sample · approximate · spectral · differential · multiscale

Every measure shares the same API: compute, rolling, delta, plot (normalized where a theoretical maximum exists). Series in → Series out (index preserved); ndarray in → ndarray out.

Method Returns
compute float
rolling Series/ndarray, same length
delta Series/ndarray (first difference)
normalized float in [0, 1] (where defined)
plot matplotlib.figure.Figure

Real-world example — food-trend analysis (NextOnMenu)

import pandas as pd
from entroscope import shannon

matcha_trends = pd.read_csv("matcha_trends.csv")["interest"]
shannon.plot(matcha_trends, window=20, title="Matcha — entropy over time")
# entropy drops before a trend goes mainstream

A sustained drop in rolling Shannon entropy means search interest is becoming concentrated/structured rather than noisy — an early signal of a trend.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entroscope-0.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entroscope-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file entroscope-0.1.0.tar.gz.

File metadata

  • Download URL: entroscope-0.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for entroscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab7e30422ab2bfc5dc40559c51cba3ee18ca34bd2a0cceae56e7caa48cced7d5
MD5 2b05f2a90746dc0cffa7eb98703c1206
BLAKE2b-256 348d15c93b3273d74eac3291e3ccc747640f982baa53916d733daeca3c07380e

See more details on using hashes here.

File details

Details for the file entroscope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: entroscope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for entroscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f9169bcf6a18378a8b40b89832f7f8b99130dcbd6a8513c0e455dd7429eb9c
MD5 2ed58e42178b9e64102da21fa715b730
BLAKE2b-256 e1bee6378d3f909c97d76d97242bdf1d816a25cf45b3d8b7e731b0e84ddf5754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page