archetypal.utils.top

archetypal.utils.top(series, df, weighting_variable)[source]

Compute the highest ranked value weighted by some other variable. Implements

pandas.DataFrame.nlargest().

Parameters
  • series (pandas.Series) – the series on which to compute the ranking.

  • df (pandas.DataFrame) – the df containing weighting variables.

  • weighting_variable (str or list or tuple) – Name of weights to use in df. If multiple values given, the values are multiplied together.

Returns

the weighted top ranked variable

Return type

numpy.ndarray