MCPcopy
hub / github.com/microsoft/qlib / fill_test_na

Function fill_test_na

examples/benchmarks/TFT/tft.py:84–91  ·  view source on GitHub ↗
(test_df)

Source from the content-addressed store, hash-verified

82
83
84def fill_test_na(test_df):
85 test_df_res = test_df.copy()
86 feature_cols = ~test_df_res.columns.str.contains("label", case=False)
87 test_feature_fna = (
88 test_df_res.loc[:, feature_cols].groupby("datetime", group_keys=False).apply(lambda df: df.fillna(df.mean()))
89 )
90 test_df_res.loc[:, feature_cols] = test_feature_fna
91 return test_df_res
92
93
94def process_qlib_data(df, dataset, fillna=False):

Callers 1

process_qlib_dataFunction · 0.85

Calls 5

copyMethod · 0.80
containsMethod · 0.80
fillnaMethod · 0.80
applyMethod · 0.45
meanMethod · 0.45

Tested by

no test coverage detected