Fix test warning

This commit is contained in:
Matthias
2022-09-27 08:10:58 +00:00
parent 43e847ff2f
commit 8c2e473ee5
5 changed files with 9 additions and 9 deletions

View File

@@ -370,10 +370,10 @@ class Backtesting:
for col in HEADERS[5:]:
tag_col = col in ('enter_tag', 'exit_tag')
if col in df_analyzed.columns:
df_analyzed.loc[:, col] = df_analyzed.loc[:, col].replace(
df_analyzed[col] = df_analyzed.loc[:, col].replace(
[nan], [0 if not tag_col else None]).shift(1)
elif not df_analyzed.empty:
df_analyzed.loc[:, col] = 0 if not tag_col else None
df_analyzed[col] = 0 if not tag_col else None
df_analyzed = df_analyzed.drop(df_analyzed.head(1).index)