A take on k-means clustering in python.
By providing two-dimentional data the algorith creates a user pre-defined number of random points on the space. After that the algorith calculates the distance between the points and the dataset and reiterates the point choise in order to minimize the mean square error. When the algorith point choise stops to converge to some value the procedure stops and the fialized groups are define.