You can implement it, albeit more slowly, in pure python using just 20-30 lines of code. I wrote a blog a while back showing how kmeans can be used to identify dominant colors in images. It has many applications and is a handy tool to use for roughly grouping data. Care is needed to pick the optimal starting centroids and k.