Commit Graph

53 Commits

Author SHA1 Message Date
Raymond Hettinger 733b9a308e
bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111) 2019-11-11 23:35:06 -08:00
Raymond Hettinger 5eabec022b
bpo-38521: Fix error in NormalDist.__eq__() (GH-16840) 2019-10-18 14:20:35 -07:00
Raymond Hettinger 7ce4bfa8cf
Minor code and comment cleanup (GH-16315) 2019-09-20 21:46:52 -07:00
Raymond Hettinger 272d0d017a
bpo-36546: No longer a need to make "data" positional only (GH-16252) 2019-09-17 20:45:05 -07:00
Raymond Hettinger 4db25d5c39
bpo-36018: Address more reviewer feedback (GH-15733) 2019-09-08 16:57:58 -07:00
Raymond Hettinger e4810b2a6c
bpo-36324: Apply review comments from Allen Downey (GH-15693) 2019-09-05 00:18:47 -07:00
Dong-hee Na 0a18ee4be7 bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) 2019-08-23 15:20:30 -07:00
Raymond Hettinger 8183bb8150
bpo-36324: Update comments to include the target hash sums (GH-15110) 2019-08-04 11:52:04 -07:00
Raymond Hettinger 1c0e9bb94b
Minor whitespace, indentation, and quoting changes to improve internal consistency and appease linters (GH-14888) 2019-07-21 12:13:07 -07:00
Raymond Hettinger 02c91f59b6
bpo-36324: Make internal attributes for statistics.NormalDist() private. (GH-14871)
* Make internals private

* Finish making mu and sigma private

* Add missing __hash__() method

* Add blurb
2019-07-21 00:34:47 -07:00
Raymond Hettinger eed5e9a956
bpo-36546: Clean-up comments (GH-14857) 2019-07-19 01:57:22 -07:00
Raymond Hettinger 1791128677
bpo-36546: Mark first argument as position only (GH-14363) 2019-06-25 04:39:22 +02:00
Raymond Hettinger 6c01ebcc0d
bpo-37158: Simplify and speed-up statistics.fmean() (GH-13832) 2019-06-05 07:39:38 -07:00
Raymond Hettinger cba9f84725
bpo-36546: Add design notes to aid future discussions (GH-13769) 2019-06-02 21:07:43 -07:00
Raymond Hettinger fb8c7d5332
bpo-36018: Make "seed" into a keyword only argument (GH-12921) 2019-04-23 01:46:18 -07:00
Raymond Hettinger 7280048690
bpo-35904: Add missing fmean() entry to the summary table (GH-12919) 2019-04-23 01:35:16 -07:00
Raymond Hettinger 9013ccf6d8
bpo-36546: Add statistics.quantiles() (#12710) 2019-04-23 00:06:35 -07:00
Raymond Hettinger 6463ba3061
bpo-27181: Add statistics.geometric_mean() (GH-12638) 2019-04-07 09:20:03 -07:00
Raymond Hettinger d1e768a677
bpo-36326: Let inspect.getdoc() find docstrings for __slots__ (GH-12498) 2019-03-25 13:01:13 -07:00
Raymond Hettinger fe13883f01 bpo-36324: Improved code formatting for the NormalDist.inv_cdf rational approximation (GH-12448)
https://bugs.python.org/issue36324
2019-03-19 14:29:13 -07:00
Raymond Hettinger 52a594bd0d NormalDist.inv_cdf(): In-line constants because the variable names were not informative (GH-12446) 2019-03-19 12:48:04 -07:00
Raymond Hettinger 5f1e8b4d24 Add docstrings to the arithmetic methods in NormalDist() (GH-12426) 2019-03-18 22:24:15 -07:00
Raymond Hettinger 714c60d7ac
bpo-36324: Add inv_cdf() to statistics.NormalDist() (GH-12377) 2019-03-18 20:17:14 -07:00
Raymond Hettinger 41f0b78cbf Simplify overlap() formula for case where variances are equal (GH-12323) 2019-03-14 02:25:26 -07:00
Raymond Hettinger fc06a192fd
bpo-35892: Fix mode() and add multimode() (#12089) 2019-03-12 00:43:27 -07:00
Raymond Hettinger 318d537daa
bpo-36169 : Add overlap() method to statistics.NormalDist (GH-12149) 2019-03-06 22:59:40 -08:00
Raymond Hettinger ef17fdbc1c bpo-36018: Add special value tests and make minor tweaks to the docs (GH-12096)
https://bugs.python.org/issue36018
2019-02-28 09:16:25 -08:00
Raymond Hettinger 9e456bc70e bpo-36018: Add properties for mean and stdev (GH-12022)
Responding to suggestions on the tracker and some off-line suggestions.

Davin suggested that english named accessors instead of greek letters would result in more intelligible user code. Steven suggested that the parameters still need to be *mu* and *theta* which are used elsewhere (and I noted those parameter names are used in linked-to resources). 

Michael suggested proving-out the API by seeing whether it generalized to *Lognormal*.  I did so and found that Lognormal distribution parameters *mu* and *sigma*  do not represent the mean and standard deviation of the lognormal distribution (instead, they are for the underlying regular normal distribution).

Putting these ideas together, we have NormalDist parameterized by *mu* and *sigma* but offering English named properties for accessors.  That gives lets us match other API that access mu and sigma, it matches the external resources on the topic, gives us clear english names in user code. The API extends nicely to LogNormal where the parameters and the summary statistic accessors are not the same.


https://bugs.python.org/issue36018
2019-02-24 11:44:55 -08:00
Raymond Hettinger 79fbcc597d bpo-36018: Make __pos__ return a distinct instance of NormDist (GH-12009)
https://bugs.python.org/issue36018
2019-02-23 22:19:01 -08:00
Raymond Hettinger 11c7953165
bpo-36018: Add the NormalDist class to the statistics module (GH-11973) 2019-02-23 14:44:07 -08:00
Raymond Hettinger 47d9987247
bpo-35904: Add statistics.fmean() (GH-11892) 2019-02-21 15:06:29 -08:00
Victor Stinner d6debb24e0 bpo-29919: Remove unused imports found by pyflakes (#137)
Make also minor PEP8 coding style fixes on modified imports.
2017-03-27 16:05:26 +02:00
Steven D'Aprano fb315dbe82 Issue #27181 remove geometric_mean and defer for 3.7. 2016-10-05 03:24:45 +11:00
Raymond Hettinger 15f44ab043 Issue #27895: Spelling fixes (Contributed by Ville Skyttä). 2016-08-30 10:47:49 -07:00
Steven D'Aprano d6ea3011c5 Remove support for nth root of negative numbers with odd powers.
Although nth roots of negative numbers are real for odd n, the
statistics module doesn't make use of this. Remove support for
negative roots from the private _nth_root function, which
simplifies the test suite.
2016-08-24 12:48:12 +10:00
Steven D'Aprano e5803d9d2f Add geometric_mean to __all__ 2016-08-24 12:17:00 +10:00
Steven D'Aprano 0a21c729eb Re-licence statistics.py under the standard Python licence. 2016-08-24 02:40:03 +10:00
Steven D'Aprano 9a2be91c6b Issue27181 add geometric mean. 2016-08-09 13:58:10 +10:00
Steven D'Aprano a474afdddc Add harmonic mean and tests. 2016-08-09 12:49:01 +10:00
Benjamin Peterson ab078e9ed1 Backed out changeset af29d89083b3 (closes #25548) (closes #27498) 2016-07-13 21:13:29 -07:00
Kushal Das 5801ecb440 Issue #25548: Showing memory address of class objects in repl 2016-06-04 16:21:13 -07:00
Martin Panter f157982b2c Issue #27076: More doc and comment spelling fixes for 3.6, by Ville Skyttä 2016-05-26 06:03:33 +00:00
Steven D'Aprano cc22984d9e Issue 26977, remove unneeded line in pvariance (duplicate call to _ss). 2016-05-08 22:14:38 +10:00
Steven D'Aprano 3b06e24352 Issue 26002 and 25974
patches by Upendra Kumar and Stefan Krah
speed up median by using bisect, and general speedup for Decimals using as_integer_ratio
2016-05-05 03:54:29 +10:00
Steven D'Aprano b28c3275c7 Issue #25177: Fixed problem with the mean of very small and very large numbers. 2015-12-01 19:59:53 +11:00
Zachary Ware 32dcf40af0 Issue #25494: Merge with 3.4 2015-10-27 22:01:02 -05:00
Zachary Ware df2660e430 Issue #25494: Remove extra quote from docstring.
Patch by John Mark Vandenberg.
2015-10-27 22:00:41 -05:00
Raymond Hettinger df1b699447 Issue #22823: Use set literals instead of creating a set from a list 2014-11-09 15:56:33 -08:00
Nick Coghlan 4a7668adca Close #20536: correctly handle Decimal exponents in statistics 2014-02-08 23:55:14 +10:00
Nick Coghlan 73afe2a972 Close #20481: Disallow mixed type input in statistics
The most appropriate coercion rules are not yet clear, so simply
disallowing mixed type input for 3.4.

(Committed on Steven's behalf)
2014-02-08 19:58:04 +10:00