finding centroid of cluster
i have done the final project of Data Science course. my code has solved 4 test cases and 1 gives error. unfortunately it's a hidden case, so i cannot understand what should I do. that is the problem: https://www.sololearn.com/learning/eom-project/1093/108 here is my code: import numpy as np n = int(input()) data = [[float(i) for i in input().split()] for j in range(n) ] def dist(a, b): x = a[0]-b[0] y = a[1]-b[1] res = np.sqrt(x**2+y**2) return res clus_1 = [] clus_2 = [] for point in data: if(dist(point,[0,0])<=dist(point,[2,2])): clus_1.append(point) else: clus_2.append(point) res_1 = np.array(clus_1, dtype=np.float32) res_1 = res_1.mean(axis=0) res_1 = np.round(res_1, decimals=2) res_2 = np.array(clus_2, dtype=np.float32) res_2 = res_2.mean(axis=0) res_2 = np.round(res_2, decimals=2) print(res_1) print(res_2)