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

Update processor.

This commit is contained in:
lwwang1995
2020-11-12 13:17:10 +08:00
parent d45aa86fb5
commit 063bfd4621

15
qlib/data/dataset/processor.py Normal file → Executable file
View File

@@ -112,16 +112,13 @@ class Fillna(Processor):
"""Process infinity """
def __call__(self, df):
def fill_na(data):
def process_na(df):
for col in df.columns:
# FIXME: Such behavior is very weird
df[col] = df[col].fillna(0)
return df
def fill_na(df):
for col in df.columns:
# FIXME: Such behavior is very weird
df[col] = df[col].fillna(0)
data = datetime_groupby_apply(data, process_na)
data.sort_index(inplace=True)
return data
df.sort_index(inplace=True)
return df
return fill_na(df)