f4enix.output.mctal.normalize_tally#
- f4enix.output.mctal.normalize_tally(df: DataFrame, user_label: str = 'Daughter', inplace: bool = True) DataFrame#
Adds a ‘Normalized Value’ column to the DataFrame, representing the relative contribution of each user_label in each unique bin defined by the other columns.
- Parameters:
df (pd.DataFrame) – The input DataFrame, must contain a column named as user_label and ‘Value’.
user_label (str, optional) – The name of the user column to normalize over (default is “User”).
inplace (bool, optional) – If True, modifies the DataFrame in place. If False, returns a new DataFrame.
- Returns:
DataFrame with an added ‘Normalized Value’ column.
- Return type:
pd.DataFrame