tacco.utils.mode

mode(df, seed=42)[source]

Calculates the most frequent value per row in a dataframe. If multiple values are the most frequent ones, take one of them at random.

Parameters:
  • df – A DataFrame with the values to get the modes from

  • seed – The random seed.

Returns:

Returns a Series with the modes.