Given points X (n, d) and centroids C (k, d), return
(labels, new_centroids):
labels (n,) assigns each point to its nearest centroid by squared Euclidean
distance, with ties going to the lowest indexnew_centroids (k, d) is the mean of each clusterInput
X =
[[ 0. 0.]
[ 0. 1.]
[10. 10.]]
C =
[[0. 0.]
[9. 9.]]
Output
(array([0, 0, 1]), array([[ 0. , 0.5],
[10. , 10. ]]))