from sklearn.cluster import KMeans
for key, value in points_dict.items():
# x = np.mean([point[0] for point in value])
#设置聚类数量为1
kmeans = KMeans(n_clusters=1)
kmeans.fit(value)
#获取聚类后的中心坐标点
center_points = kmeans.cluster_centers_
points_dict[key] = center_points
return points_dict