MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / optimized_rolling_diff

Function optimized_rolling_diff

loggers/analysis.py:27–28  ·  view source on GitHub ↗
(series, window_size)

Source from the content-addressed store, hash-verified

25 return np.log(series / series.shift(step)).dropna().reset_index(drop=True)
26
27def optimized_rolling_diff(series, window_size):
28 return series.rolling(window=window_size).apply(lambda x: x.iloc[-1] - x.iloc[0], raw=False).shift(-(window_size - 1))
29
30def process_file(f):
31 df = pd.read_csv(f)

Callers 1

process_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected