This is a basic k-means sample code.
When you run this code, you need to install numpy and matplotlib.
Step 1:
Clustering by Vertical bisector.
Step 2:
Clustering by Euler's formula in while loop. When centroid points stop to update the position, break the loop.
Step 3:
Print the result.