From 5716df995164f03f7f4a715529183c867da8b719 Mon Sep 17 00:00:00 2001 From: Richard <49528843+rich-pel@users.noreply.github.com> Date: Wed, 6 May 2020 13:08:14 +0200 Subject: [PATCH] update feature_to_label.py path could be given by args[] --- code/kappa_data/feature_to_label.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/kappa_data/feature_to_label.py b/code/kappa_data/feature_to_label.py index 4390c92..940c155 100644 --- a/code/kappa_data/feature_to_label.py +++ b/code/kappa_data/feature_to_label.py @@ -57,7 +57,8 @@ def add_label(df): if __name__ == "__main__": - path = # path to label files for which a class should be estimated + path = '.' # path to label files for which a class should be estimated + print("Path is current folder") # get all csv files in path csvs = [x for x in os.listdir(path) if x.endswith('.csv')] # open files and add the corresponding labels to each image id @@ -66,4 +67,4 @@ def add_label(df): df = pd.read_csv(full_path, delimiter=';') new_df = add_label(df) new_file_name = full_path + 'labeltestnew.csv' - export_csv = new_df.to_csv(new_file_name) \ No newline at end of file + export_csv = new_df.to_csv(new_file_name)