reVeal.normalization.get_values#

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

Get values of the specified attribute from the input dataframe, optionally inverting via multiplying by -1.

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

  • attribute (str) – Name of attribute for which to get values.

  • invert (bool) – If True, invert values by multiplying by -1. If False, return values as is from df.

Returns:

pandas.Series – Series of values. The returned series will have the name “value”.

Raises:
  • KeyError – A KeyError will be raised if the specified attribute is not found in the input dataframe

  • TypeError – A TypeError will be raised if the specified attribute is not a numeric dtype.