def sorted_centers(kmeans):
    """
    Sort centers by the first coordinate in the KMeans object.

    Parameters
    ----------
    kmeans : KMeans
        The KMeans object.

    Returns
    -------
    ndarray
        Sorted values in KMeans.cluster_centers_ by the first column.
    """
    return kmeans.cluster_centers_[kmeans.cluster_centers_[:, (0)].argsort()]
