This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make the documentation for statistics' data argument clearer.
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steven.daprano Nosy List: Mariatta, docs@python, nedbat, python-dev, rhettinger, steven.daprano
Priority: normal Keywords: patch

Created on 2016-08-21 20:56 by nedbat, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue27825.patch Mariatta, 2016-10-06 04:17 review
issue27825v2.patch Mariatta, 2016-10-15 04:44 review
Messages (6)
msg273318 - (view) Author: Ned Batchelder (nedbat) * (Python triager) Date: 2016-08-21 20:56
The docs for statistics.mean say, "Return the sample arithmetic mean of data, a sequence or iterator of real-valued numbers."  Most of the functions in statistics have a `data` argument, but this function is the only one that says, "a sequence or iterator."  The examples all show lists.

The page would be better if the introduction mentioned what `data` could be, instead of having to guess that median can take an iterator because mean says that it can.
msg278168 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-10-06 04:17
Updated the docs and updated the example codes as well.

Please review :)
msg278694 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-10-15 04:44
Updated patch based on feedback.

Steven, I removed the example of median_grouped using Fractions.
Would you be able to suggest better examples to be added in the docs?

I also noticed that there are more examples of median_grouped in the paragraph below. 

Thanks.
msg281414 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-11-22 00:32
New changeset 71dd21a3b9cc by Raymond Hettinger in branch '3.6':
Issue #27825: Improve for statistics data arguments. (Contributed by Mariatta Wijaya.)
https://hg.python.org/cpython/rev/71dd21a3b9cc
msg281416 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-11-22 00:32
Thanks Mariatta.

As discussed in chat, I dropped the extra fractions examples because they didn't seem to add value.
msg281418 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-11-22 00:33
Sounds good. Thanks, Raymond :)
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 72012
2016-11-22 00:33:51Mariattasetmessages: + msg281418
2016-11-22 00:32:58rhettingersetstatus: open -> closed

nosy: + rhettinger
messages: + msg281416

resolution: fixed
2016-11-22 00:32:06python-devsetnosy: + python-dev
messages: + msg281414
2016-10-15 04:44:37Mariattasetfiles: + issue27825v2.patch

messages: + msg278694
2016-10-06 04:17:36Mariattasetfiles: + issue27825.patch

nosy: + Mariatta
messages: + msg278168

keywords: + patch
2016-08-23 14:37:06steven.dapranosetassignee: docs@python -> steven.daprano

nosy: + steven.daprano
2016-08-21 20:56:47nedbatcreate