def _validate_center_shape(X, n_centers, centers):
    """Check if centers is compatible with X and n_centers"""
    if len(centers) != n_centers:
        raise ValueError(
            'The shape of the initial centers (%s) does not match the number of clusters %i'
             % (centers.shape, n_centers))
    if centers.shape[1] != X.shape[1]:
        raise ValueError(
            'The number of features of the initial centers %s does not match the number of features of the data %s.'
             % (centers.shape[1], X.shape[1]))
