def _calc_survfunc_right(time, status):
    """
    Calculate the survival function and its standard error for a single
    group.
    """

    time = np.asarray(time)
    status = np.asarray(status)

    # Convert the unique times to ranks (0, 1, 2, ...)
    time, rtime = np.unique(time, return_inverse=True)

    # Number of deaths at each unique time.
    d = np.bincount(rtime, weights=status)

    # Size of risk set just prior to each event time.
    n = np.bincount(rtime)
    n = np.cumsum(n[::-1])[::-1]

    # Only retain times where an event occured.
    ii = np.flatnonzero(d > 0)
    d = d[ii]
    n = n[ii]
    time = time[ii]

    # The survival function probabilities.
    sp = d / n.astype(np.float64) - 1
    sp = np.log(sp)
    sp = np.cumsum(sp)
    sp = np.exp(sp)

    # Standard errors (Greenwood's formula).
    se = d / (n * (n - d)).astype(np.float64)
    se = np.cumsum(se)
    se = np.sqrt(se)
    se *= sp

    return sp, se, time, n, d
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/duration/survfunc.py/_calc_survfunc_right/swapped operands of `-`