Statistics Functions
statistics.mode()
Find a most frequently occurring hashable observation. Ties return the first encountered mode; use multimode for all tied values.
Formal Syntax & Structure
python syntaxpython
statistics.mode(data)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | iterable of hashable objects | Observations to count by value. |
Return Value
object
A selected data item.
Working Example
Example Snippetpython
import statisticsprint(statistics.mode(['red', 'blue', 'red']))