Re: Treatment of NANs in the statistics module

2018-03-18 Thread Rustom Mody
On Saturday, March 17, 2018 at 3:22:46 PM UTC+5:30, Léo El Amri wrote: > On 17/03/2018 00:16, Steven D'Aprano wrote: > > The bug tracker currently has a discussion of a bug in the median(), > > median_low() and median_high() functions that they wrongly compute the > > medians in the face of NANs

Re: Treatment of NANs in the statistics module

2018-03-17 Thread duncan smith
On 16/03/18 23:16, Steven D'Aprano wrote: > The bug tracker currently has a discussion of a bug in the median(), > median_low() and median_high() functions that they wrongly compute the > medians in the face of NANs in the data: > > https://bugs.python.org/issue33084 > > I would like to ask peo

Re: Treatment of NANs in the statistics module

2018-03-17 Thread Léo El Amri
On 17/03/2018 00:16, Steven D'Aprano wrote: > The bug tracker currently has a discussion of a bug in the median(), > median_low() and median_high() functions that they wrongly compute the > medians in the face of NANs in the data: > > https://bugs.python.org/issue33084 > > I would like to ask p

Re: Treatment of NANs in the statistics module

2018-03-17 Thread Steven D'Aprano
On Sat, 17 Mar 2018 16:41:01 +1100, Ben Finney wrote: >> (4) median() should strip out NANs. > > Too much magic. Statistically, ignoring NANs is equivalent to taking them as missing values. That is, for the purposes of calculating some statistic (let's say, median, although it applies to other

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Ben Finney
Ben Finney writes: > Steven D'Aprano writes: > > > (1) […] If there is a NAN in your data, the result of calling > > median() is implementation-defined. > > This is the least Pythonic; there is no good reason IMO for specifying a > behaviour in the implementation. That's a confused statement. I

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Ben Finney
Steven D'Aprano writes: > I would like to ask people how they would prefer to handle [the > computation of median when the data set contains NaN]: > > (1) Put the responsibility on the caller to strip NANs from their > data. If there is a NAN in your data, the result of calling median() > is impl

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Steven D'Aprano
On Fri, 16 Mar 2018 22:08:42 -0400, Terry Reedy wrote: > On 3/16/2018 7:16 PM, Steven D'Aprano wrote: >> The bug tracker currently has a discussion of a bug in the median(), >> median_low() and median_high() functions that they wrongly compute the >> medians in the face of NANs in the data: [...]

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Terry Reedy
On 3/16/2018 7:16 PM, Steven D'Aprano wrote: The bug tracker currently has a discussion of a bug in the median(), median_low() and median_high() functions that they wrongly compute the medians in the face of NANs in the data: https://bugs.python.org/issue33084 I would like to ask people how the

Treatment of NANs in the statistics module

2018-03-16 Thread Steven D'Aprano
The bug tracker currently has a discussion of a bug in the median(), median_low() and median_high() functions that they wrongly compute the medians in the face of NANs in the data: https://bugs.python.org/issue33084 I would like to ask people how they would prefer to handle this issue: (1) Put