k-means clustering is a method of vector quantization, originally from signal processing, that aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean (cluster centers or cluster centroid), serving as a prototype of the cluster.
Although kmeans is conviniently packaged in sklearn, this is a self-try version of kmeans implementation in python.
This implementation of kmeans is completely done in python.