Files
drift/utils/resample.py
T
Mark Aron Szulyovszky 8dd2d88740 chore(Linter): reformatted code with black (#211)
* chore(Linter): reformatted code with black

* Create black.yaml
2022-02-17 19:22:17 +01:00

11 lines
310 B
Python

import pandas as pd
def resample_ohlc(df, period):
output = pd.DataFrame()
output["open"] = df.open.resample(period).first()
output["high"] = df.high.resample(period).max()
output["low"] = df.low.resample(period).min()
output["close"] = df.close.resample(period).last()
return output