def construct_survival_curves(hazard_rates, timelines):
    """
    Given hazard rates, reconstruct the survival curves

    Parameters
    ----------
    hazard_rates: (n,t) array
    timelines: (t,) the observational times

    Returns
    -------
    t: survial curves, (n,t) array
    """
    cumulative_hazards = cumulative_integral(hazard_rates.values, timelines)
    return pd.DataFrame(np.exp(-cumulative_hazards), index=timelines)
def construct_survival_curves ( hazard_rates , timelines ) : cumulative_hazards = cumulative_integral ( hazard_rates . values , timelines ) return pd . DataFrame ( np . exp ( - cumulative_hazards ) , index = timelines )
Given hazard rates, reconstruct the survival curves

    Parameters
    ----------
    hazard_rates: (n,t) array
    timelines: (t,) the observational times

    Returns
    -------
    t: survial curves, (n,t) array