File: calc_mean_deco.py

package info (click to toggle)
python-deprecated 1.2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,308 kB
  • sloc: python: 1,458; makefile: 32
file content (16 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from deprecated.sphinx import deprecated


@deprecated(
    reason="""Since Python 3.4, you can use the standard function :func:`statistics.mean`.""",
    version="2.5.0",
)
def mean(values):
    """
    Compute the arithmetic mean (“average”) of values.

    :type  values: typing.List[float]
    :param values: List of floats
    :return: Mean of values.
    """
    return sum(values) / len(values)