On this page
statistics.StatisticsError
Prev: statistics.quantiles | Up: statistics | Next: statistics.stdev
Rel: statistics.correlation, statistics.covariance, statistics.fmean, statistics.geometric_mean
Ref: docs.python.org โ statistics.StatisticsError
Tags: #public #python3 #stdlib #statistics
Import
import statistics
from statistics import StatisticsError
Signature & Overview
statistics.StatisticsError(...)
statistics.StatisticsError class.
Methods & Attributes
StatisticsError.add_note(self, note, /)โ Add a note to the exceptionStatisticsError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import statistics
try:
statistics.mean([])
except statistics.StatisticsError:
assert issubclass(statistics.StatisticsError, ValueError)
Gotchas
- Subclass of
ValueError: Raised on empty data or insufficient points (e.g.,stdev([1])).
REPL Inspect
from statistics import StatisticsError
help(StatisticsError)
Linked from
Related notes
- tuts/python3/stdlib_module/statistics/quantiles Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/stdev Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/statistics/correlation Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/covariance Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/fmean Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/geometric_mean Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/harmonic_mean shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/kde shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/kde_random shared tags: #statistics, #stdlib