1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-17 09:24:34 +08:00
This commit is contained in:
zhupr
2021-08-29 23:49:54 +08:00
committed by you-n-g
parent 3605cd7b96
commit ee5f3de800
3 changed files with 4 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ data_handler_config: &data_handler_config
sample_config: sample_config:
feature: feature:
- class: ResampleProcessor - class: ResampleProcessor
moudle_path: features_sample.py module_path: features_sample.py
kwargs: kwargs:
freq: 1d freq: 1d
hour: 13 hour: 13

View File

@@ -217,9 +217,8 @@ class QlibDataLoader(DLWParser):
warnings.warn("`filter_pipe` is not None, but it will not be used with `instruments` as list") warnings.warn("`filter_pipe` is not None, but it will not be used with `instruments` as list")
freq = self.freq[gp_name] if self.can_sample else self.freq freq = self.freq[gp_name] if self.can_sample else self.freq
df = D.features( inst_processor = self.sample_config.get(gp_name, None) if self.can_sample else None
instruments, exprs, start_time, end_time, freq=freq, inst_processors=self.sample_config.get(freq, None) df = D.features(instruments, exprs, start_time, end_time, freq=freq, inst_processors=inst_processor)
)
df.columns = names df.columns = names
if self.swap_level: if self.swap_level:
df = df.swaplevel().sort_index() # NOTE: if swaplevel, return <datetime, instrument> df = df.swaplevel().sort_index() # NOTE: if swaplevel, return <datetime, instrument>