reVeal.normalization.calc_minmax#

calc_minmax(df, attribute, invert)[source]#

Normalize values from 0 to 1 by normalizing the range of values.

Parameters:
  • df (pandas.DataFrame) – Input dataframe

  • attribute (str) – Name of attribute to normalize.

  • invert (bool) – If True, invert values by multiplying by -1 before normalizing.

Returns:

pandas.DataFrame – DataFrame with normalized values stored in a column named “value”. Also includes the index from the input dataframe.