pyclustering/cluster/kmeans.py
def __update_centers(self):
        """!
        @brief Calculate centers of clusters in line with contained objects.
        
        @return (numpy.array) Updated centers.
        
        """
        
        dimension = self.__pointer_data.shape[1]
        centers = numpy.zeros((len(self.__clusters), dimension))
        
        for index in range(len(self.__clusters)):
            cluster_points = self.__pointer_data[self.__clusters[index], :]
            centers[index] = cluster_points.mean(axis=0)

        return numpy.array(centers)
def __update_centers(self):
        """!
        @brief Calculate centers of clusters in line with contained objects.
        
        @return (numpy.array) Updated centers.
        
        """
        
        dimension = self.__pointer_data.shape[1]
        centers = numpy.zeros((len(self.__clusters), dimension))
        
        for index in range(len(self.__clusters)):
            cluster_points = self.__pointer_data[self.__clusters[index], :]
            centers[index] = cluster_points.mean(axis=0)

        return numpy.array(centers)
def __update_centers ( self ) : dimension = self . __pointer_data . shape [ 1 ] centers = numpy . zeros ( ( len ( self . __clusters ) , dimension ) ) for index in range ( len ( self . __clusters ) ) : cluster_points = self . __pointer_data [ self . __clusters [ index ] , : ] centers [ index ] = cluster_points . mean ( axis = 0 ) return numpy . array ( centers )
!
        @brief Calculate centers of clusters in line with contained objects.
        
        @return (numpy.array) Updated centers.
!