# mode function

The most frequent value of a list, or a list of them when several are equally frequent.

## How to write it

### mode(data)

**data**

The values. Equal values are counted, in any order. Takes a list.

## Examples

- $\displaystyle \operatorname{mode}(\left[ 1, 2, 2, 3, 3, 3 \right]) = 3$

  `mode([1, 2, 2, 3, 3, 3])`

  In the solver, `mode([1, 2, 2, 3, 3, 3])` gives `3`.

  [Open in the solver](https://hilberon.com/?q=mode%28%5B1%2C%202%2C%202%2C%203%2C%203%2C%203%5D%29)
- $\displaystyle \operatorname{mode}(\left[ 1, 1, 2, 2, 3 \right]) = \left[ 1, 2 \right]$

  `mode([1, 1, 2, 2, 3])`

  In the solver, `mode([1, 1, 2, 2, 3])` gives `[1, 2]`.

  [Open in the solver](https://hilberon.com/?q=mode%28%5B1%2C%201%2C%202%2C%202%2C%203%5D%29)

## Related functions

- [normal_distribution](https://hilberon.com/library/normal_distribution)

  The normal distribution with mean mu and standard deviation sigma.
- [median](https://hilberon.com/library/median)

  The middle value of a list of numbers, or the mean of the two middle ones.
- [ornstein_uhlenbeck_process](https://hilberon.com/library/ornstein_uhlenbeck_process)

  A process pulled toward mu at rate theta, with noise sigma, started at x0.
- [mean](https://hilberon.com/library/mean)

  The average of a list of numbers, or the expected value of a distribution.
- [pdf](https://hilberon.com/library/pdf)

  The density of a distribution at a point, or the probability of a value for a discrete one.
- [ito_process](https://hilberon.com/library/ito_process)

  A process given by its drift and diffusion: dX = drift dt + diffusion dW.

---
Source: https://hilberon.com/library/mode
