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 rhettinger
Recipients francismb, rhettinger, steven.daprano
Date 2019-02-16.10:48:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550314086.65.0.76940261769.issue35892@roundup.psfhosted.org>
In-reply-to
Content
I would stick with "first_tie=False".  That caters to the common case, avoids API complications, and does something similar to what other stats packages are doing.

----- API Survey ----

Maple: """This function is only guaranteed to return one potential mode - in cases where multiple modes exist, only the first detected mode is guaranteed to be returned.""" -- https://www.maplesoft.com/support/help/maple/view.aspx?path=Statistics%2fMode

R: 'R does not have a standard in-built function to calculate mode.' -- https://www.tutorialspoint.com/r/r_mean_median_mode.htm

Matlab: "When there are multiple values occurring equally frequently, mode returns the smallest of those values. ... If A is an empty 0-by-0 matrix, mode(A) returns NaN." -- https://www.mathworks.com/help/matlab/ref/mode.html

Mathematica: "The mode of a set of data is implemented in the Wolfram Language as Commonest[data]. ... When several elements occur with equal frequency, Commonest[list,…] picks first the ones that occur first in list." -- http://mathworld.wolfram.com/Mode.html and https://reference.wolfram.com/language/ref/Commonest.html

SciPy: "If there is more than one such value, only the smallest is returned." -- https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.stats.mode.html

SAS: "Most frequent value (if not unique, the smallest mode)" -- https://documentation.sas.com/?docsetId=qcug&docsetTarget=qcug_capability_sect225.htm&docsetVersion=14.2&locale=en
History
Date User Action Args
2019-02-16 10:48:06rhettingersetrecipients: + rhettinger, steven.daprano, francismb
2019-02-16 10:48:06rhettingersetmessageid: <1550314086.65.0.76940261769.issue35892@roundup.psfhosted.org>
2019-02-16 10:48:06rhettingerlinkissue35892 messages
2019-02-16 10:48:06rhettingercreate