Skip to content

Commit 2e4ce13

Browse files
committedMar 25, 2025
add check for existing columns
1 parent 0c8ecd3 commit 2e4ce13

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
 

‎scripts/predict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def main(config_file):
6666
algorithms = App.config.get("algorithms")
6767

6868
# Select necessary features and label
69-
out_columns = ['timestamp', 'open', 'high', 'low', 'close', 'volume', 'close_time']
69+
out_columns = [time_column, 'open', 'high', 'low', 'close', 'volume', 'close_time']
7070
out_columns = [x for x in out_columns if x in df.columns]
7171
labels_present = set(labels).issubset(df.columns)
7272
if labels_present:

‎scripts/signals.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def main(config_file):
9696
#
9797
# Choose columns to stored
9898
#
99-
out_columns = ["timestamp", "open", "high", "low", "close"] # Source data
99+
out_columns = [time_column, "open", "high", "low", "close"] # Source data
100+
out_columns = [x for x in out_columns if x in df.columns]
100101
out_columns.extend(App.config.get('labels')) # True labels
101102
out_columns.extend(all_features)
102103

‎scripts/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def main(config_file):
7474
algorithms = App.config.get("algorithms")
7575

7676
# Select necessary features and labels
77-
out_columns = ['timestamp', 'open', 'high', 'low', 'close', 'volume', 'close_time']
77+
out_columns = [time_column, 'open', 'high', 'low', 'close', 'volume', 'close_time']
7878
out_columns = [x for x in out_columns if x in df.columns]
7979
all_features = train_features + labels
8080
df = df[out_columns + [x for x in all_features if x not in out_columns]]

0 commit comments

Comments
 (0)
Please sign in to comment.