On this page
  1. statistics.mode
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

statistics.mode

Prev: statistics.median_low | Up: statistics | Next: statistics.multimode
Rel: statistics.correlation, statistics.covariance, statistics.fmean, statistics.geometric_mean
Ref: docs.python.org — statistics.mode
Tags: #public #python3 #stdlib #statistics


Import

import statistics
from statistics import mode

Signature & Overview

statistics.mode(data)

Return the most common data point from discrete or nominal data.

Usage

import statistics

assert statistics.mode(['red', 'blue', 'red']) == 'red'

Gotchas

REPL Inspect

from statistics import mode
help(mode)

Linked from

Related notes