implement k-means in python (scipy)