mahalanobis

hhpy.ds.mahalanobis(point: Union[pandas.core.frame.DataFrame, pandas.core.series.Series, numpy.ndarray], df: pandas.core.frame.DataFrame = None, params: List[str] = None, do_print: bool = True) → Union[float, List[float]][source]

Calculates the Mahalanobis distance for a single point or a DataFrame of points

Parameters:
  • point – The point(s) to calculate the Mahalanobis distance for
  • df – The reference DataFrame against which to calculate the Mahalanobis distance
  • params – The columns to calculate the Mahalanobis distance for
  • do_print – Whether to print intermediate steps to the console
Returns:

if a single point is passed: Mahalanobis distance as float, else a list of floats