def ci()

in spotify_confidence/analysis/frequentist/confidence_computers/bootstrap_computer.py [0:0]


def ci(df, alpha_column: str, **kwargs: Dict[str, str]) -> Tuple[Series, Series]:
    bootstrap_samples = kwargs[BOOTSTRAPS]
    lower = df.apply(
        lambda row: np.percentile(
            row[bootstrap_samples + SFX2] - row[bootstrap_samples + SFX1], 100 * row[alpha_column] / 2
        ),
        axis=1,
    )
    upper = df.apply(
        lambda row: np.percentile(
            row[bootstrap_samples + SFX2] - row[bootstrap_samples + SFX1], 100 * (1 - row[alpha_column] / 2)
        ),
        axis=1,
    )
    return lower, upper