TimeFrame¶
- class time_stream.TimeFrame(df, time_name, resolution=None, periodicity=None, time_anchor=TimeAnchor.START, on_duplicates=DuplicateOption.ERROR)[source]¶
A class representing a time series data model, with data held in a Polars DataFrame.
- Parameters:
df (
DataFrame
) – ThePolars
DataFrame containing the time series data.time_name (
str
) – The name of the time column in the DataFrame.resolution (
Period
|str
|None
) – The resolution of the time series.periodicity (
Period
|str
|None
) – The periodicity of the time series.time_anchor (
TimeAnchor
|str
) – The time anchor to which the date/times of the time series conform to.on_duplicates (
DuplicateOption
|str
) – What to do if duplicate rows are found in the data. Default to ERROR.
Attributes¶
The resolution of the timeseries data within the TimeFrame |
|
The periodicity of the timeseries data within the TimeFrame |
|
The time anchor of the timeseries data within the TimeFrame |
|
The name of the primary datetime column in the underlying TimeFrame DataFrame. |
|
All column labels of the DataFrame within the TimeFrame. |
|
Only the labels for any flag columns within the TimeFrame. |
|
Only the labels for the data columns within the TimeFrame. |
|
TimeFrame-level metadata. |
|
Per-column metadata. |
|
The underlying |
Methods¶
Builders¶
Return a new TimeFrame with a new DataFrame, checking the integrity of the time values hasn't been compromised between the old and new TimeFrame. |
|
Return a new TimeFrame with TimeFrame-level metadata. |
|
Return a new TimeFrame with column-level metadata. |
|
Return a new TimeFrame, with a flag system registered. |
General¶
Operations¶
Apply an aggregation function to a column in this TimeFrame, check the aggregation satisfies user requirements and return a new derived TimeFrame containing the aggregated data. |
|
Apply an infilling method to a column in the TimeFrame to fill in missing data. |
|
Apply a quality control check to the TimeFrame. |
Flagging¶
Register a named flag system with the internal flag manager. |
|
Return a registered flag system. |
|
Mark the specified existing column as a flag column. |
|
Add a new column to the TimeFrame DataFrame, setting it as a Flag Column. |
|
Look up a registered flag column by name. |
|
Add flag value (if not there) to flag column, where expression is True. |
|
Remove flag value (if there) from flag column. |