Module: time_series

cesium.time_series.load(ts_path) Load serialized TimeSeries from .npz file.
cesium.time_series.TimeSeries([t, m, e, …]) Class representing a single time series of measurements and metadata.

load

cesium.time_series.load(ts_path)

Load serialized TimeSeries from .npz file.

TimeSeries

class cesium.time_series.TimeSeries(t=None, m=None, e=None, label=None, meta_features={}, name=None, path=None, channel_names=None)

Bases: object

Class representing a single time series of measurements and metadata.

A TimeSeries object encapsulates a single set of time-domain measurements, along with any metadata describing the observation. Typically the observations will consist of times, measurements, and (optionally) measurement errors. The measurements can be scalar- or vector-valued (i.e., “multichannel”); for multichannel measurements, the times and errors can also be vector-valued, or they can be shared across all channels of measurement.

Attributes

time ((n,) or (p, n) array or list of (n,) arrays) Array(s) of times corresponding to measurement values. If measurement is two-dimensional, this can be one-dimensional (same times for each channel) or two-dimensional (different times for each channel). If time is one-dimensional then it will be broadcast to match measurement.shape.
measurement ((n,) or (p, n) array or list of (n,) arrays) Array(s) of measurement values; can be two-dimensional for multichannel data. In the case of multichannel data with different numbers of measurements for each channel, measurement will be a list of arrays instead of a single two-dimensional array.
error ((n,) or (p, n) array or list of (n,) arrays) Array(s) of measurement errors for each value. If measurement is two-dimensional, this can be one-dimensional (same times for each channel) or two-dimensional (different times for each channel). If error is one-dimensional then it will be broadcast match measurement.shape.
label (str, float, or None) Class label or regression target for the given time series (if applicable).
meta_features (dict) Dictionary of feature names/values specified independently of the featurization process in featurize.
name (str or None) Identifying name for the given time series (if applicable). Typically the name of the raw data file from which the time series was created.
path (str or None) Path to the file where the time series is stored on disk (if applicable).
channel_names (list of str) List of names of channels of measurement; by default these are simply channel_{i}, but can be arbitrary depending on the nature of the different measurement channels.

Methods

channels() Iterates over measurement channels (whether one or multiple).
save([path]) Store TimeSeries object as a single .npz file.
sort() Sort times, measurements, and errors by time.
__init__(t=None, m=None, e=None, label=None, meta_features={}, name=None, path=None, channel_names=None)

Create a TimeSeries object from measurement values/metadata.

See TimeSeries documentation for parameter values.

channels()

Iterates over measurement channels (whether one or multiple).

save(path=None)

Store TimeSeries object as a single .npz file.

Attributes are stored in the following arrays:
  • time
  • measurement
  • error
  • meta_feat_names
  • meta_feat_values
  • name
  • label

If path is omitted then the path attribute from the TimeSeries object is used.

sort()

Sort times, measurements, and errors by time.