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.

Author francismb
Recipients francismb, rhettinger, steven.daprano
Date 2019-02-16.11:28:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550316503.14.0.841116202842.issue35892@roundup.psfhosted.org>
In-reply-to
Content
Good point Raymond!

Only a minor observation on the packages API:  


[1] SciPy: scipy.stats.mode(a, axis=0, nan_policy='propagate')
"Returns an array of the modal (most common) **value** in the passed array." --> Here it claims to return just ONE value

And use of different policies on parameters :
nan_policy : {‘propagate’, ‘raise’, ‘omit’}, optional
Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.

Equivalent one could say 'multivalue_policy'


[2] Matlab: Mode: "Most frequent **values** in array"

...returns the sample mode of A, which is the most frequently occurring *value* in A...."

IMHO it seems inconsistent *values* vs. *value* (or a doc-bug ?).


An a question:
Does it that mean that mode in that case really should potentially return an array of values, e.g. all the values with equal frequency?

In that case the user has the chance to get the first, the last or just all, ...


----
[1] https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.stats.mode.html

[2] https://la.mathworks.com/help/matlab/ref/mode.html
History
Date User Action Args
2019-02-16 11:28:23francismbsetrecipients: + francismb, rhettinger, steven.daprano
2019-02-16 11:28:23francismbsetmessageid: <1550316503.14.0.841116202842.issue35892@roundup.psfhosted.org>
2019-02-16 11:28:23francismblinkissue35892 messages
2019-02-16 11:28:23francismbcreate