maths.average_mode

Functions

mode(→ list[Any])

This function returns the mode(Mode as in the measures of

Module Contents

maths.average_mode.mode(input_list: list) list[Any]

This function returns the mode(Mode as in the measures of central tendency) of the input data.

The input list may contain any Datastructure or any Datatype.

>>> mode([2, 3, 4, 5, 3, 4, 2, 5, 2, 2, 4, 2, 2, 2])
[2]
>>> mode([3, 4, 5, 3, 4, 2, 5, 2, 2, 4, 4, 2, 2, 2])
[2]
>>> mode([3, 4, 5, 3, 4, 2, 5, 2, 2, 4, 4, 4, 2, 2, 4, 2])
[2, 4]
>>> mode(["x", "y", "y", "z"])
['y']
>>> mode(["x", "x" , "y", "y", "z"])
['x', 'y']