def train_valid_test_split(df, train_proportion):
    """Splits the dataframe into train/valid/test.

    Train will consist of `train_proportion` many of the rows, valid and test
    split the rest evenly.
    """

    train_size = int(train_proportion * len(df))
    valid_size = (len(df) - train_size) // 2

    train = df[:train_size]
    valid = df[train_size:train_size + valid_size]
    test = df[train_size + valid_size:]

    return train, valid, test