Resamples the dataframe with the given `period` while using `time` as an index.
(df: pd.DataFrame, time_index: pd.Series, period="1S")
| 115 | |
| 116 | |
| 117 | def resample(df: pd.DataFrame, time_index: pd.Series, period="1S"): |
| 118 | """Resamples the dataframe with the given `period` while using `time` as an index.""" |
| 119 | time_range = get_time_range(time_index) |
| 120 | time_length = time_range.start - time_range.end |
| 121 | df.index = time_index |
| 122 | if pd.Timedelta(period) < time_length: |
| 123 | df = df.resample(period).first() |
| 124 | return df.interpolate() |
| 125 | |
| 126 | |
| 127 | def is_valid_process(process: ProcessInfo) -> bool: |
no test coverage detected