def normalize(df):
    """
    Normalizes columns per wiki for a selected number of features (listed in 'cols' variable).

    :param df: DataFrame whose columns are to be normalized
    :return: DataFrame
    """
    cols = [
        "editors",
        "major_edits",
        "anonymous_edits",
        "pls",
        "transcluded_in",
    ]

    for col in cols:
        if col in df.columns:
            df[col + "_norm"] = (
                df[col] / df.groupby("dbname")[col].transform("sum")
            ) * 100
            del df[col]

    return df