def series_cdf(series):
    """Calculate cdf of series preserving the index

    Parameters
    ----------
    series : series like

    Returns
    -------
    cdf : series

    """
    index = series.index.tolist()
    total = series.sum(skipna=True)
    cdf = series.cumsum(skipna=True) / total
    return cdf