Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2130d3f8
Commit
2130d3f8
authored
Oct 05, 2016
by
Steven D'Aprano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #27181 remove geometric_mean and defer for 3.7.
parent
8ab0c960
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
564 deletions
+3
-564
Doc/library/statistics.rst
Doc/library/statistics.rst
+0
-29
Lib/statistics.py
Lib/statistics.py
+1
-268
Lib/test/test_statistics.py
Lib/test/test_statistics.py
+0
-267
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/statistics.rst
View file @
2130d3f8
...
...
@@ -39,7 +39,6 @@ or sample.
======================= =============================================
:func:`mean` Arithmetic mean ("average") of data.
:func:`geometric_mean` Geometric mean of data.
:func:`harmonic_mean` Harmonic mean of data.
:func:`median` Median (middle value) of data.
:func:`median_low` Low median of data.
...
...
@@ -113,34 +112,6 @@ However, for reading convenience, most of the examples show sorted sequences.
``mean(data)`` is equivalent to calculating the true population mean μ.
.. function:: geometric_mean(data)
Return the geometric mean of *data*, a sequence or iterator of
real-valued numbers.
The geometric mean is the *n*-th root of the product of *n* data points.
It is a type of average, a measure of the central location of the data.
The geometric mean is appropriate when averaging quantities which
are multiplied together rather than added, for example growth rates.
Suppose an investment grows by 10% in the first year, falls by 5% in
the second, then grows by 12% in the third, what is the average rate
of growth over the three years?
.. doctest::
>>> geometric_mean([1.10, 0.95, 1.12])
1.0538483123382172
giving an average growth of 5.385%. Using the arithmetic mean will
give approximately 5.667%, which is too high.
:exc:`StatisticsError` is raised if *data* is empty, or any
element is less than zero.
.. versionadded:: 3.6
.. function:: harmonic_mean(data)
Return the harmonic mean of *data*, a sequence or iterator of
...
...
Lib/statistics.py
View file @
2130d3f8
This diff is collapsed.
Click to expand it.
Lib/test/test_statistics.py
View file @
2130d3f8
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
2130d3f8
...
...
@@ -50,6 +50,8 @@ Core and Builtins
Library
-------
- Issue #27181 remove statistics.geometric_mean and defer until 3.7.
- Issue #28229: lzma module now supports pathlib.
- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment