Import and export#

Import, export and interoperability.

Segmentations and collections are exchanged with pandas, files and the other Python time series libraries: ruptures (change points), tslearn, sktime and aeon (3-D arrays), STUMPY (matrix profile), and the companion packages of the Complex Systems Intelligence group: spmviz (frequent sequential patterns of symbolic and episode sequences) and fuzzyclust (fuzzy clustering of feature representations).

pandas, long-format tables, JSON segmentations, ruptures and other formats.

Functions#

from_dataframe(df[, columns, time_column])

Series (T, n) and variable names from a wide pandas DataFrame (sorted by time_column if given).

to_dataframe(X[, names, segmentation, index])

Wide DataFrame of a series, optionally with segment and state columns.

collection_from_long(df, id_column[, ...])

Collection from a long table (one row per sample, id_column per series); returns (collection, labels or None, ids).

to_numpy3d(collection[, layout, length, pad])

3-D array of a collection.

from_numpy3d(A[, layout])

Collection from a 3-D array; trailing all-NaN samples are removed.

save_segmentation(segmentation, path)

Write a segmentation to JSON.

load_segmentation(path)

from_ruptures(bkps, **kwargs)

Segmentation from ruptures breakpoints (last element = T).

to_ruptures(segmentation)

ruptures_segment(X[, algorithm, model, pen, ...])

Run a ruptures detector (pip install ruptures) and return an mvtsa Segmentation.

to_spmviz(sequences)

Symbol or episode sequences as an spmviz.SequenceDatabase (pip install spmviz); episodes are replaced by their primitive codes.

matrix_profile_stumpy(x, window)

Matrix profile of a univariate series with STUMPY (pip install stumpy): (profile, index).