Implementation of the k-means algorithm in python3