def survival_df(data, t_col="t", e_col="e", label_col="Y", exclude_col=[]):
    """
    Transform original DataFrame to survival dataframe that would be used in model 
    training or predicting.

    Parameters
    ----------
    data: DataFrame
        Survival data to be transformed.
    t_col: str
        Column name of data indicating time.
    e_col: str
        Column name of data indicating events or status.
    label_col: str
        Name of new label in transformed survival data.
    exclude_col: list
        Columns to be excluded.

    Returns
    -------
    DataFrame:
        Transformed survival data. Negtive values in label are taken as right censored.
    """
    x_cols = [c for c in data.columns if c not in [t_col, e_col] + exclude_col]

    # Negtive values are taken as right censored
    data.loc[:, label_col] = data.loc[:, t_col]
    data.loc[data[e_col] == 0, label_col] = - data.loc[data[e_col] == 0, label_col]

    return data[x_cols + [label_col]]