tspy.data_structures.stream_time_series.SegmentStreamTimeSeries module¶
-
class
tspy.data_structures.stream_time_series.SegmentStreamTimeSeries.SegmentStreamTimeSeries(tsc, j_stream_time_series, trs=None)¶ Bases:
tspy.data_structures.stream_time_series.StreamTimeSeries.StreamTimeSeriesA special form of stream-time-series that consists of observations with a value of type
SegmentMethods
add_sink(data_sink)add a data-sink to this piece of the streaming pipeline.
fillna(interpolator[, null_value])produce a new stream-time-series which is the result of filling all null values.
filter(func)produce a new stream-time-series which is the result of filtering by each observation’s value given a filter function.
flatmap(func)produce a new stream-time-series where each observation’s value in this stream-time-series is mapped to 0 to N new values.
full_join(right_time_series[, join_func, …])join two stream-time-series based on a temporal full join strategy and optionally interpolate missing values
inner_join(right_time_series[, join_func])join two stream-time-series based on a temporal inner join strategy
interval_join(right_stream_ts, filter_func, …)join two stream-time-series where observations in the right stream lie within an interval of this stream.
left_join(right_time_series[, join_func, …])join two stream-time-series based on a temporal left join strategy and optionally interpolate missing values
left_outer_join(right_time_series[, …])join two stream-time-series based on a temporal left outer join strategy and optionally interpolate missing values
map(func)produce a new stream-time-series where each observation’s value in this stream-time-series is mapped to a new observation value
peek()Optionally get the most recent values in the queue without flushing the queue.
poll([polling_interval])Get the most recent values in the queue.
resample(periodicity, func)produce a new stream-time-series by resampling the current stream-time-series to a given periodicity
right_join(right_time_series[, join_func, …])join two stream-time-series based on a temporal right join strategy and optionally interpolate missing values
right_outer_join(right_time_series[, …])join two stream-time-series based on a temporal right outer join strategy and optionally interpolate missing values
run()run the streaming pipeline
segment(window[, step])produce a new segment-time-series from a performing a sliding-based segmentation over the time-series
segment_by_anchor(anchor_op, left_delta, …)produce a new segment-time-series from performing an anchor-based segmentation over the time-series.
segment_by_time(window[, step])produce a new segment-time-series from a performing a time-based segmentation over the time-series
to_observation_stream()- Returns
transform(reducer)transform this stream-time-series of segments into a stream-time-series of values
transform_segments(transform)produce a new segment-stream-time-series where each segment is transformed to a new segment using a unary transform
with_trs([granularity, start_time])create a new stream-time-series with its timestamps mapped based on a granularity and start_time.
-
filter(func)¶ produce a new stream-time-series which is the result of filtering by each observation’s value given a filter function.
- Parameters
- funcfunc
the filter on observation’s value function
- Returns
StreamTimeSeriesa new stream-time-series
Notes
see
filter()for usage
-
transform(reducer)¶ transform this stream-time-series of segments into a stream-time-series of values
- Parameters
- reducerreducer transform
a reducer transform as seen in
reducers
- Returns
StreamTimeSeriesa new stream-time-series
Notes
Because this observation values are of segment type, a reducer will be used (transform from segment to value)
-
transform_segments(transform)¶ produce a new segment-stream-time-series where each segment is transformed to a new segment using a unary transform
- Parameters
- transformUnaryTransform
the transformation to apply on each segment of this segment-stream-time-series
- Returns
SegmentStreamTimeSeriesa new segment-stream-time-series