Python K-Means implementation with Partial Distance Strategy