Implementation of K-Means algorithm in Python