Skip to content
Snippets Groups Projects
Commit e528f829 authored by dmt's avatar dmt
Browse files

Drop columns by name and not by index.

parent ca487650
No related branches found
No related tags found
No related merge requests found
......@@ -37,8 +37,9 @@ class DataSource:
class Preprocessor:
TARGET_COLUMN = "Z"
TIME_COLUMN = "T"
TARGET_COLUMN = "Z"
SIGMA_COLUMN = "Sigma"
def __init__(self, settings):
self.settings = settings
......@@ -55,12 +56,13 @@ class Preprocessor:
if self.settings.cut_time_stamp:
self._remove_common_time_stamp_prefix(table)
return table
def _drop_irrelevant_columns(self, table):
# TODO (dmt): Don't drop T, Z and Sigma columns!
for column in table.get_columns():
column_index = table.get_column_index_by_name(column)
if column_index not in self.settings.set_features:
table.drop_column_by_index(column_index)
features_to_be_removed = [table.get_column_name_by_index(i)
for i in self.settings.set_features]
for column in features_to_be_removed:
table.drop_column_by_name(column)
def _overwrite_target_column(self, table):
table.set_column_value(self.TARGET_COLUMN, self.settings.set_targets)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment