algorithms/k-means/algorithms.py
def points_to_clusters(this):
        """
        Assign points to the cluster of the closest center.
        :return: None
        """
        this.clusters = [[] for i in range(this.k)]  # clusters[i] is the list of points in cluster i.

        for p in this.distances.keys():
            this.clusters[np.argmin(this.distances[p])].append(p)

        Assign points to the cluster of the closest center.
        :return: None
        
Assign points to the cluster of the closest center.
Assign points to the cluster of the closest center .
def points_to_clusters(this):
        this.clusters = [[] for i in range(this.k)]  
        for p in this.distances.keys():
            this.clusters[np.argmin(this.distances[p])].append(p)
def points_to_clusters ( this ) : this . clusters = [ [ ] for i in range ( this . k ) ] for p in this . distances . keys ( ) : this . clusters [ np . argmin ( this . distances [ p ] ) ] . append ( p )
Assign points to the cluster of the closest center.
Assign points to the cluster of the closest center .
"""
        Assign points to the cluster of the closest center.
        :return: None
        """ # clusters[i] is the list of points in cluster i.
None
this