nimble.calculate.mode

nimble.calculate.mode(values)

The mode of the values in a vector.

When the mode can be more than one value, those values are sorted and the middle value (for an odd number of mode values) or first value to the left of the middle (for an even number of mode values) will be returned.

Parameters:

values (nimble Base object) – Must be one-dimensional.

See also

mean, median

Examples

>>> lst = [0, 1, 2, float('nan'), float('nan'), float('nan'), 0, 6]
>>> vector = nimble.data(lst)
>>> mode(vector)
0.0