1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 00:06:58 +08:00

Merge branch 'high-freq-execution' into high-freq-execution

This commit is contained in:
Mingzhe-Han
2021-09-17 11:08:53 +08:00
committed by GitHub
4 changed files with 17 additions and 15 deletions

View File

@@ -6,13 +6,17 @@ feature_path = os.path.join(data_path, 'feature/teacher/')
if not os.path.exists(feature_path):
os.makedirs(feature_path)
log_file = os.path.join(os.environ.get('OUTPUT_DIR'),'example/OPDT_b/0/test/')
log_file = os.path.join(os.environ.get('OUTPUT_DIR'),'example/OPDT_b/test/')
files = os.listdir(log_file)
for f in files:
if f.endswith(".log"):
df = pd.read_pickle(log_file + f)
df['datetime'] = df.index.get_level_values(1).map(lambda x: x[1])
#df['datetime'] = df.index.get_level_values(1).map(lambda x: x[1])
df['datetime'] = df.index.get_level_values(1)
df.set_index('datetime', append=True, drop=True, inplace=True)
action = df['action']
action = action.reset_index(level=1, drop=True)