MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / resample

Function resample

benchmarks/src/postprocessing/monitor.py:117–124  ·  view source on GitHub ↗

Resamples the dataframe with the given `period` while using `time` as an index.

(df: pd.DataFrame, time_index: pd.Series, period="1S")

Source from the content-addressed store, hash-verified

115
116
117def 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
127def is_valid_process(process: ProcessInfo) -> bool:

Callers 6

accumulateFunction · 0.85
render_processFunction · 0.85
render_process_cpu_timeFunction · 0.85

Calls 1

get_time_rangeFunction · 0.85

Tested by

no test coverage detected