From 98a86a97c04caf4b2cb292d5fe98653ba954c0ce Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 15 Apr 2021 18:35:31 +0200 Subject: [PATCH] Minor refactor in results report --- src/processing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processing.py b/src/processing.py index 9bf06f8..0539c7a 100644 --- a/src/processing.py +++ b/src/processing.py @@ -15,7 +15,6 @@ def get_first_solution(n, data): ) furthest_index = distance_sum["distance"].astype(float).idxmax() furthest_row = distance_sum.iloc[furthest_index] - furthest_row["distance"] = 0 return furthest_row @@ -105,10 +104,10 @@ def execute_algorithm(choice, n, m, data): def show_results(solutions, time_delta): distance_sum = solutions["distance"].sum() - duplicates = solutions.duplicated() + duplicates = solutions.duplicated().any() print(solutions) print("Total distance: " + str(distance_sum)) - if solutions[duplicates].empty: + if not duplicates: print("No duplicates found") print("Execution time: " + str(time_delta))