1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00

Fix the index type of the multi-freq example

This commit is contained in:
zhupr
2021-08-30 18:36:38 +08:00
committed by you-n-g
parent ee5f3de800
commit 6e88ccca88

View File

@@ -11,6 +11,7 @@ class ResampleProcessor(InstProcessor):
self.minute = minute
def __call__(self, df: pd.DataFrame, *args, **kwargs):
df.index = pd.to_datetime(df.index)
df = df.loc[df.index.time == datetime.time(self.hour, self.minute)]
df.index = df.index.normalize()
return df