Registry / data / tsfeatures

tsfeatures

JSON →
library0.4.5pypypi✓ verified 81d ago

Calculates various features from time series data, including autocorrelation, entropy, seasonality, stationarity, and trend-based metrics. Designed for time series classification and preprocessing. Current stable version is 0.4.5. Release cadence is irregular based on fixes and feature additions.

pip install tsfeatures
INSTALL
IMPORT
SIG · TSFEATURES
T
tsfeatures
datapythonv0.4.5
Install
21.3s avg
Import
Disk
600MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.5 · 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
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 21.3s · import 0.000s · 587MB
600MB installed
● package 600MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AR
from tsfeatures import AR
from tsfeatures import Tsfeatures
acf
from tsfeatures import acf
from tsfeatures import Tsfeatures
arch_stat
from tsfeatures import arch_stat
from tsfeatures import Tsfeatures

Compute default set of time series features on a single time series column.

import pandas as pd from tsfeatures import Tsfeatures # Sample time series data: one column with datetime index dates = pd.date_range('2020-01-01', periods=50, freq='D') df = pd.DataFrame({'value': [i + (i%10)*0.5 for i in range(50)]}, index=dates) tf = Tsfeatures() features = tf.calculate_features(df) print(features)
Debug
Known issues
breakingChanged from function-based to class-based API in v0.1.0. Old code using `tsfeatures.calculate_features(df)` no longer works. Use `Tsfeatures().calculate_features(df)` instead.
fix
Upgrade to >=0.1.0 and use the Tsfeatures class.
affects: <0.1.0
gotchaInput DataFrame must have a DatetimeIndex; otherwise features relying on frequency detection (like seasonal features) may fail or produce NaNs.
fix
Ensure index is a pandas DatetimeIndex with a recognizable frequency (e.g., 'D', 'H'). If not needed, use `Tsfeatures(freq=1)` to treat as non-seasonal.
affects: >=0.1.0
gotchaSome features require the `antropy` library; if not installed, those features are silently skipped. No error raised.
fix
Install antropy: `pip install antropy` to get entropy-based features.
affects: >=0.3.0
deprecatedThe `freq` parameter in `calculate_features` is deprecated as of v0.4.0. Use `Tsfeatures(freq=...)` constructor instead.
fix
Pass frequency to Tsfeatures constructor: `tf = Tsfeatures(freq=24)`.
affects: 0.4.0 and later
Upgrade
Version history
0.4.5latest on PyPI · released Jun 20, 2023
Audit
Dependencies
pandasrequiredData manipulation required for input/output.
numpyrequiredNumerical operations used internally.
statsmodelsrequiredUsed for ARIMA coefficients, unit root tests, etc.
antropyoptionalProvides entropy features (sample entropy, etc.).
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
tsfeatures — pip install tsfeatures · libregistry