def METHOD_NAME(self, x: DNDarray, matching_centroids: DNDarray):
    """
    Compute coordinates of new centroid as mean of the data points in ``x`` that are assigned to this centroid.
    Parameters
    ----------
    x :  DNDarray
        Input data
    matching_centroids : DNDarray
        Array filled with indices ``i`` indicating to which cluster ``ci`` each sample point in ``x`` is assigned
    """
    new_cluster_centers = self._cluster_centers.copy()
    for i in range(self.n_clusters):
        # points in current cluster
        selection = (matching_centroids == i).astype(ht.int64)
        # accumulate points and total number of points in cluster
        assigned_points = x * selection
        points_in_cluster = selection.sum(axis=0, keepdims=True).clip(
            1.0, ht.iinfo(ht.int64).max
        )
        # compute the new centroids
        new_cluster_centers[i : i + 1, :] = (assigned_points / points_in_cluster).sum(
            axis=0, keepdims=True
        )
    return new_cluster_centers