[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2019-03-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I'm closing this issue in favour of Raymond's #35892, thank you to everyone 
even if your PRs didn't get used, I appreciate your efforts.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2019-03-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

See the competing proposal and PR at https://bugs.python.org/issue35892 and 
https://github.com/python/cpython/pull/12089

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2019-03-10 Thread Henry Chen


Henry Chen  added the comment:

Yes, the mode function could ALWAYS return a list, but that breaks backward 
compatibility, as does the currently proposed change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2019-03-10 Thread Henry Chen


Henry Chen  added the comment:

The problem remains that the function can return a number or a list for input 
that is a list of numbers. This means the user will need to handle both 
possibilities every time, which is a heavy burden for such a simple function.

SciPy's mode function does return the minimum mode when there is a tie, which 
as far as I can tell is an arbitrary choice. But in that context, since the 
input is almost always numerical, a minimum is at least well defined, which is 
not true for an input with a mix of types.

For the general use case, the current behavior - raising an exception - in case 
of tie conveys the most information.

--
nosy: +scotchka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28956] return list of modes for a multimodal distribution instead of raising a StatisticsError

2018-02-18 Thread Srikanth Anantharam

Srikanth Anantharam  added the comment:

Please review the new PR with tests.
I'll update the documentation if the PR is acceptable.

--
title: return minimum of modes for a multimodal distribution instead of raising 
a StatisticsError -> return list of modes for a multimodal distribution instead 
of raising a StatisticsError

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com