Returns a function that filters a single time series to the specified time-range.
Each time-range acts as an individual series. Setting a time-range for your query makes them more efficient as your query will only read the points in the time-range, instead of all the points in the time series. This is also useful for doing operations on intervals of time series.
FunctionNode
) -> FunctionNode
Column name | Type | Description |
---|---|---|
timestamp | pandas.Timestamp | Timestamp of the point |
value | float | str |
Copied!1 2 3 4 5 6 7
>>> series = F.points((1, 1.0), (101, 2.0), (200, 4.0), (201, 8.0), name="series") >>> series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000001 1.0 1 1970-01-01 00:00:00.000000101 2.0 2 1970-01-01 00:00:00.000000200 4.0 3 1970-01-01 00:00:00.000000201 8.0
Copied!1 2 3 4 5
>>> time_range = F.time_range(start=200, end=202)(series) >>> time_range.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000200 4.0 1 1970-01-01 00:00:00.000000201 8.0
Copied!1 2 3 4
>>> smaller_time_range = F.time_range(start=200, end=201)(series) >>> smaller_time_range.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000200 4.0
Copied!1 2 3 4 5 6
>>> unbounded_start_range = F.time_range(end=201)(series) >>> unbounded_start_range.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000001 1.0 1 1970-01-01 00:00:00.000000101 2.0 2 1970-01-01 00:00:00.000000200 4.0
Copied!1 2 3 4 5 6
>>> unbounded_end_range = F.time_range(start=101)(series) >>> unbounded_end_range.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000101 2.0 1 1970-01-01 00:00:00.000000200 4.0 2 1970-01-01 00:00:00.000000201 8.0