[issue35698] [statistics] Division by 2 in statistics.median

2019-01-14 Thread STINNER Victor


STINNER Victor  added the comment:

> I find Steve's closing of the issue premature, but I'm not going to reverse 
> it.

Steven D'Aprano is the maintainer of the module (he wrote 450 and implemented 
it), he has the last word.

Steven D'Aprano, Raymond Hettinger and me are 3 core developers and in favor of 
closing the issue.

--

___
Python tracker 

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



[issue35698] [statistics] Division by 2 in statistics.median

2019-01-14 Thread Jonathan Fine


Jonathan Fine  added the comment:

I'm still thinking about this.

I find Steve's closing of the issue premature, but I'm not going to reverse it.

--

___
Python tracker 

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



[issue35698] [statistics] Division by 2 in statistics.median

2019-01-14 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I agree that for numeric data, it isn't worth changing the behaviour of median 
to avoid the division in the case of two equal middle values.

Even if we did accept this feature request, it is not going to eliminate the 
change in type in all circumstances. median([1, 2]) will still return 1.5. And 
in practical terms, the conditions where this would apply are likely to be 
quite unusual for numeric data. (Ordinal data is likely to be a different 
story.)

One way or another, the caller has to expect that the median of an even number 
of ints may return a number which is a float. If the caller doesn't want that 
behaviour, they can use median_low or median_high, which never take the average 
and always return a value from the data set.

--
resolution:  -> not a bug
stage:  -> 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



[issue35698] [statistics] Division by 2 in statistics.median

2019-01-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> As a pure mathematician, to me 1.0 means a number that is 
> close to 1. Whereas 1 means a number that is exactly 1.

Descriptive statistics performed on a computer using actual measurements is 
pretty far from "pure mathematics" ;-)

Making this change is likely pointless for most users and likely confusing for 
others (i.e. why the type switch between median([1, 1]) and median([1, 3]).

I concur with Victor and recommend closing.

--
assignee:  -> steven.daprano
nosy: +rhettinger

___
Python tracker 

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



[issue35698] [statistics] Division by 2 in statistics.median

2019-01-10 Thread Brett Cannon


Change by Brett Cannon :


--
title: Division by 2 in statistics.median -> [statistics] Division by 2 in 
statistics.median

___
Python tracker 

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