diff --git a/src/experiments/csv_merger.py b/src/experiments/csv_merger.py new file mode 100644 index 0000000..c8a8ce2 --- /dev/null +++ b/src/experiments/csv_merger.py @@ -0,0 +1,33 @@ +import csv + +SIFT_PATH = "src\\experiments\\algorithms\\data\\sift.csv" +SUITE_PATH = "dataset\\csv\\result-2023-10-14T16.13.30.csv" +OUTPUT_DIR = "dataset\\csv\\" + +data = [] +with open(SIFT_PATH) as file: + reader = csv.reader(file, delimiter=',') + lst = list(reader) + for row in lst: + data.append(row) + +new_data = [] +with open(SUITE_PATH) as file: + reader = csv.reader(file, delimiter=',') + lst = list(reader) + for row in lst: + new_data.append(row) + +data[0].extend(new_data[0][2:]) +for element in data[1:]: + for new_element in new_data[1:]: + if int(element[1]) == int(new_element[1]): + for idx in new_element[2:]: + element.append(idx) + print(element[1], new_element[1]) + +with open(OUTPUT_DIR + "combined.csv", 'w') as file: + for element in data: + for idx in element: + file.write(str(idx) + ',') + file.write('\n') \ No newline at end of file