def FPKM_to_TPM(df):
    """FPKM expression values to TPMs.
    The sum of all TPMs in each sample are the same.
    Refer to : https://www.rna-seqblog.com/rpkm-fpkm-and-tpm-clearly-explained/

    Parameters
    ----------
        df: pandas.DataFrame
            Each row is a gene, and each column is a sample.

    Returns
    -------
        a pandas.DataFrame with the same shape as df.
    """
    colSum = df.sum(axis=0)
    df = df.div(colSum, axis=1) * 1e+6
    return df