Re: [Python-Dev] PEP 450 adding statistics module

2013-09-18 Thread Ethan Furman
On 09/18/2013 01:26 AM, Antoine Pitrou wrote: Le Tue, 17 Sep 2013 14:40:21 -0700, Ethan Furman a écrit : On 09/17/2013 02:21 PM, Guido van Rossum wrote: Congrats, I've accepted the PEP. Nice work! Please work with the reviewers on the issue on the code. Congratulations, Stephen! Or Steven

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-18 Thread Antoine Pitrou
Le Tue, 17 Sep 2013 14:40:21 -0700, Ethan Furman a écrit : > On 09/17/2013 02:21 PM, Guido van Rossum wrote: > > Congrats, I've accepted the PEP. Nice work! Please work with the > > reviewers on the issue on the code. > > Congratulations, Stephen! Or Steven even ;)

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Oscar Benjamin
On 17 September 2013 22:21, Guido van Rossum wrote: > Congrats, I've accepted the PEP. Nice work! Please work with the reviewers > on the issue on the code. Good work, Steven! ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mai

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Nick Coghlan
On 18 Sep 2013 08:36, "Ethan Furman" wrote: > > On 09/17/2013 02:21 PM, Guido van Rossum wrote: >> >> Congrats, I've accepted the PEP. Nice work! Please work with the reviewers on the issue on the code. > > > Congratulations, Stephen! Yay! Cheers, Nick. > > -- > ~Ethan~ > >

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Ethan Furman
On 09/17/2013 02:21 PM, Guido van Rossum wrote: Congrats, I've accepted the PEP. Nice work! Please work with the reviewers on the issue on the code. Congratulations, Stephen! -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Steven D'Aprano
On Tue, Sep 17, 2013 at 02:21:16PM -0700, Guido van Rossum wrote: > Congrats, I've accepted the PEP. Nice work! Please work with the reviewers > on the issue on the code. Thank you, and thanks to everyone who contributed with the discussion. > (Steven or Oscar, if either of you could work Oscar's

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Guido van Rossum
Congrats, I've accepted the PEP. Nice work! Please work with the reviewers on the issue on the code. (Steven or Oscar, if either of you could work Oscar's list of resolved issues into a patch for the PEP I'll happily update it, just mail it to p...@python.org.) On Mon, Sep 16, 2013 at 5:06 PM, G

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-16 Thread Guido van Rossum
On Mon, Sep 16, 2013 at 4:59 PM, Steven D'Aprano wrote: > On Mon, Sep 16, 2013 at 08:42:12AM -0700, Guido van Rossum wrote: > > I'm ready to accept this PEP. Because I haven't read this entire thread > > (and 60 messages about random diversions is really too much to try and > > catch up on) I'll g

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-16 Thread Steven D'Aprano
On Mon, Sep 16, 2013 at 08:42:12AM -0700, Guido van Rossum wrote: > I'm ready to accept this PEP. Because I haven't read this entire thread > (and 60 messages about random diversions is really too much to try and > catch up on) I'll give people 24 hours to remind me of outstanding > rejections. >

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-16 Thread Guido van Rossum
I'm ready to accept this PEP. Because I haven't read this entire thread (and 60 messages about random diversions is really too much to try and catch up on) I'll give people 24 hours to remind me of outstanding rejections. I also haven't reviewed the code in any detail, but I believe the code revie

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-16 Thread Oscar Benjamin
On 16 September 2013 16:42, Guido van Rossum wrote: > I'm ready to accept this PEP. Because I haven't read this entire thread (and > 60 messages about random diversions is really too much to try and catch up > on) I'll give people 24 hours to remind me of outstanding rejections. > > I also haven't

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-13 Thread Steven D'Aprano
On Sun, Sep 08, 2013 at 10:51:57AM -0700, Guido van Rossum wrote: > Never mind, I found the patch and the issue. I really think that the > *PEP* is ready for inclusion after the open issues are changed into > something like Discussion or Future Work, and after adding a more > prominent link to the

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Nick Coghlan
On 9 Sep 2013 22:58, "Oscar Benjamin" wrote: > > On 9 September 2013 12:56, Nick Coghlan wrote: > >> Alternatively, I thought there was discussion a long time ago about > >> getting numpy's > >> (or even further back, numeric's?) array type into the core. Python > >> has an array type > >> which

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 12:56, Nick Coghlan wrote: >> Alternatively, I thought there was discussion a long time ago about >> getting numpy's >> (or even further back, numeric's?) array type into the core. Python >> has an array type >> which I don't think gets a lot of use (or love). Might it be >> wo

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Nick Coghlan
On 9 Sep 2013 20:46, "Skip Montanaro" wrote: > > > However, it's common in economic statistics to have a rectangular > > array, and extract both certain rows (tuples of observations on > > variables) and certain columns (variables). For example you might > > have data on populations of American s

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Steven D'Aprano
On Mon, Sep 09, 2013 at 05:44:43AM -0500, Skip Montanaro wrote: > > However, it's common in economic statistics to have a rectangular > > array, and extract both certain rows (tuples of observations on > > variables) and certain columns (variables). For example you might > > have data on populatio

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Skip Montanaro
> However, it's common in economic statistics to have a rectangular > array, and extract both certain rows (tuples of observations on > variables) and certain columns (variables). For example you might > have data on populations of American states from 1900 to 2012, and > extract the data on New E

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 04:16, Guido van Rossum wrote: > > Yeah, so this and Steven's review of various other APIs suggests that the > field of statistics hasn't really reached the object-oriented age (or > perhaps the OO view isn't suitable for the field), and people really think > of their data as a

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 09:02, Serhiy Storchaka wrote: > 08.09.13 20:52, Guido van Rossum написав(ла): > >> Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are >> long. > > Perhaps we need zip.from_iterable()? I would prefer it if chain.from_iterable were named something like f

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Serhiy Storchaka
08.09.13 20:52, Guido van Rossum написав(ла): Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are long. Perhaps we need zip.from_iterable()? ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/lis

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Paul Colomiets
Hi Guido, On Sun, Sep 8, 2013 at 8:32 PM, Guido van Rossum wrote: > Going over the open issues: > > - Parallel arrays or arrays of tuples? I think the API should require > an array of tuples. It is trivial to zip up parallel arrays to the > required format, while if you have an array of tuples, e

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Terry Reedy
On 9/8/2013 10:57 PM, Stephen J. Turnbull wrote: I don't necessarily find this persuasive. It's more common when working with existing databases that you add variables than add observations. My experience with general scientific research is the opposite. One decides on the variables to measu

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Terry Reedy
On 9/8/2013 5:41 PM, Guido van Rossum wrote: On Sun, Sep 8, 2013 at 1:48 PM, Oscar Benjamin wrote: On 8 September 2013 18:32, Guido van Rossum wrote: Going over the open issues: - Parallel arrays or arrays of tuples? I think the API should require an array of tuples. It is trivial to zip up

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Steven D'Aprano
On Mon, Sep 09, 2013 at 12:26:05PM +1200, Greg wrote: > On 9/09/2013 5:52 a.m., Guido van Rossum wrote: > >Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are > >long. > > Would it be worth having a transpose() function in the stdlib > somewhere, that returns a view instead

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Steven D'Aprano
On Sun, Sep 08, 2013 at 09:14:39PM +0100, Paul Moore wrote: > On 8 September 2013 20:19, Steven D'Aprano wrote: > [...] > > Is this satisfactory or do I need to go into more detail? > > It describes only 7 functions, and yet you state there are 11. I'd > suggest you add a 1-line summary of each f

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
On Sun, Sep 8, 2013 at 5:26 PM, Greg wrote: > On 9/09/2013 5:52 a.m., Guido van Rossum wrote: > >> Well, to me zip(*x) is unnatural, and it's inefficient when the arrays >> are long. >> > > Would it be worth having a transpose() function in the stdlib > somewhere, that returns a view instead of c

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
Yeah, so this and Steven's review of various other APIs suggests that the field of statistics hasn't really reached the object-oriented age (or perhaps the OO view isn't suitable for the field), and people really think of their data as a matrix of some sort. We should respect that. Now, if this was

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Greg
On 9/09/2013 5:52 a.m., Guido van Rossum wrote: Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are long. Would it be worth having a transpose() function in the stdlib somewhere, that returns a view instead of copying the data? -- Greg __

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Stephen J. Turnbull
Guido van Rossum writes: > On Sun, Sep 8, 2013 at 1:48 PM, Oscar Benjamin > wrote: > > On 8 September 2013 18:32, Guido van Rossum wrote: > >> Going over the open issues: > >> > >> - Parallel arrays or arrays of tuples? I think the API should require > >> an array of tuples. It is trivial

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Steven D'Aprano
On Sun, Sep 08, 2013 at 02:41:35PM -0700, Guido van Rossum wrote: > On Sun, Sep 8, 2013 at 1:48 PM, Oscar Benjamin > wrote: > > The most obvious alternative that isn't explicitly mentioned in the > > PEP is to accept either: > > > > def correlation(x, y=None): > > if y is None: > > xs

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
On Sun, Sep 8, 2013 at 1:48 PM, Oscar Benjamin wrote: > On 8 September 2013 18:32, Guido van Rossum wrote: >> Going over the open issues: >> >> - Parallel arrays or arrays of tuples? I think the API should require >> an array of tuples. It is trivial to zip up parallel arrays to the >> required f

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Oscar Benjamin
On 8 September 2013 18:32, Guido van Rossum wrote: > Going over the open issues: > > - Parallel arrays or arrays of tuples? I think the API should require > an array of tuples. It is trivial to zip up parallel arrays to the > required format, while if you have an array of tuples, extracting the >

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Paul Moore
On 8 September 2013 20:19, Steven D'Aprano wrote: [...] > Is this satisfactory or do I need to go into more detail? It describes only 7 functions, and yet you state there are 11. I'd suggest you add a 1-line summary of each function, something like: mean - calculate the (arithmetic) mean of the

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Steven D'Aprano
On Sun, Sep 08, 2013 at 10:25:22AM -0700, Guido van Rossum wrote: > Steven, I'd like to just approve the PEP, given the amount of > discussion that's happened already (though I didn't follow much of > it). I quickly glanced through the PEP and didn't find anything I'd > personally object to, but th

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are long. On Sun, Sep 8, 2013 at 10:45 AM, Alexander Belopolsky wrote: > > On Sun, Sep 8, 2013 at 9:32 PM, Guido van Rossum wrote: >> >> - Parallel arrays or arrays of tuples? I think the API should require >> an array of tup

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
Never mind, I found the patch and the issue. I really think that the *PEP* is ready for inclusion after the open issues are changed into something like Discussion or Future Work, and after adding a more prominent link to the issue with the patch. Then the *patch* can be reviewed some more until it

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Alexander Belopolsky
On Sun, Sep 8, 2013 at 9:32 PM, Guido van Rossum wrote: > - Parallel arrays or arrays of tuples? I think the API should require > an array of tuples. It is trivial to zip up parallel arrays to the > required format, while if you have an array of tuples, extracting the > parallel arrays is slightl

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
Steven, I'd like to just approve the PEP, given the amount of discussion that's happened already (though I didn't follow much of it). I quickly glanced through the PEP and didn't find anything I'd personally object to, but then I found your section of open issues, and I realized that you don't actu

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Guido van Rossum
Going over the open issues: - Parallel arrays or arrays of tuples? I think the API should require an array of tuples. It is trivial to zip up parallel arrays to the required format, while if you have an array of tuples, extracting the parallel arrays is slightly more cumbersome. Also for manipulat

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Ethan Furman
On 09/08/2013 06:52 AM, Ryan wrote: ...what's a PEP dictator? The person tasked with deciding on the fate of an individual PEP. -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Antoine Pitrou
On Sat, 31 Aug 2013 12:58:39 +1000 Steven D'Aprano wrote: > Hi all, > > > I think that PEP 450 is now ready for a PEP dictator. Perhaps Mark would like to apply? Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org https://mail.pyth

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Ryan
...what's a PEP dictator? Steven D'Aprano wrote: > > >I'd like to get some attention for this please. > > >On Sat, Aug 31, 2013 at 12:58:39PM +1000, Steven D'Aprano wrote: >> Hi all, >> >> >> I think that PEP 450 is now ready for a PEP dictator. There have been >a >> number of code reviews, a

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Steven D'Aprano
I'd like to get some attention for this please. On Sat, Aug 31, 2013 at 12:58:39PM +1000, Steven D'Aprano wrote: > Hi all, > > > I think that PEP 450 is now ready for a PEP dictator. There have been a > number of code reviews, and feedback has been taken into account. The test > suite passe

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-30 Thread Steven D'Aprano
Hi all, I think that PEP 450 is now ready for a PEP dictator. There have been a number of code reviews, and feedback has been taken into account. The test suite passes. I'm not aware of any unanswered issues with the code. At least two people other than myself think that the implementation is

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Oscar Benjamin
On Aug 16, 2013 11:05 AM, "Steven D'Aprano" wrote: > > I'll provide two functions: mode, which returns the single value with the highest frequency, or raises; and a second function, which collates the data into a sorted (value, frequency) list. Bike-shedding on the name of this second function is

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Steven D'Aprano
On 16/08/13 17:47, Oscar Benjamin wrote: I can't think of a situation where 1 or 2 modes are acceptable but 3 is not. The only forms I can imagine using are mode(data) to get the unique mode if it exists and mode(data, max_modes=None) to get the set of all modes. Hmmm, I think you are right. Th

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Mark Shannon
On 15/08/13 14:08, Steven D'Aprano wrote: On 15/08/13 21:42, Mark Dickinson wrote: The PEP and code look generally good to me. I think the API for median and its variants deserves some wider discussion: the reference implementation has a callable 'median', and variant callables 'median.low',

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Antoine Pitrou
On Fri, 16 Aug 2013 12:44:54 +1000 Steven D'Aprano wrote: > On 16/08/13 04:10, Eric V. Smith wrote: > > > I agree with Mark: the proposed median, median.low, etc., doesn't feel > > right. Is there any example of doing this in the stdlib? > > The most obvious case is datetime: we have datetime()

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Oscar Benjamin
On 15 August 2013 14:08, Steven D'Aprano wrote: > > - The API doesn't really feel very Pythonic to me. For example, we write: > > mystring.rjust(width) > dict.items() > > rather than mystring.justify(width, "right") or dict.iterate("items"). So I > think individual methods is a better API, and one

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eli Bendersky
On Thu, Aug 15, 2013 at 7:44 PM, Steven D'Aprano wrote: > On 16/08/13 04:10, Eric V. Smith wrote: > > I agree with Mark: the proposed median, median.low, etc., doesn't feel >> right. Is there any example of doing this in the stdlib? >> > > The most obvious case is datetime: we have datetime(), an

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 8/15/2013 10:44 PM, Steven D'Aprano wrote: > On 16/08/13 04:10, Eric V. Smith wrote: > >> I agree with Mark: the proposed median, median.low, etc., doesn't feel >> right. Is there any example of doing this in the stdlib? > > The most obvious case is datetime: we have datetime(), and > datetime

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Terry Reedy
On 8/15/2013 10:44 PM, Steven D'Aprano wrote: The most obvious case is datetime: we have datetime(), and datetime.now(), datetime.today(), and datetime.strftime(). The only API difference between it and median is that datetime is a type and median is not, but that's a difference that makes no di

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Steven D'Aprano
On 16/08/13 04:24, R. David Murray wrote: I too prefer the median_low naming rather than median.low. I'm not sure I can articulate why, but certainly the fact that that latter isn't used anywhere else in the stdlib that I can think of is probably a lot of it:) And the reason it's not used in t

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Steven D'Aprano
On 16/08/13 04:10, Eric V. Smith wrote: I agree with Mark: the proposed median, median.low, etc., doesn't feel right. Is there any example of doing this in the stdlib? The most obvious case is datetime: we have datetime(), and datetime.now(), datetime.today(), and datetime.strftime(). The onl

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread R. David Murray
On Thu, 15 Aug 2013 23:28:39 +0300, Michael Foord wrote: > > On 15 Aug 2013, at 21:10, "Eric V. Smith" wrote: > > > On 08/15/2013 01:58 PM, Mark Dickinson wrote: > >> On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano >> > wrote: > >> > >> > >>- Each scheme end

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Nick Coghlan
+1 for the PEP in general from me, but using the underscore based pseudo-namespace for the median variants. The attribute approach isn't *wrong*, just surprising enough that I think independent functions with the "median_" prefix in their name is a better idea. Cheers, Nick. _

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Terry Reedy
On 8/14/2013 9:25 PM, Steven D'Aprano wrote: Hi all, I have raised a tracker item and PEP for adding a statistics module to the standard library: http://bugs.python.org/issue18606 http://www.python.org/dev/peps/pep-0450/ There has been considerable discussion on python-ideas, I have avoided

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Terry Reedy
On 8/15/2013 4:16 PM, Eric V. Smith wrote: itertools.chain.from_iterable. But I think that was a mistake, too. As a recent discussion showed, it's not exactly discoverable. The fact that it's not mentioned in the list of functions at the top of the documentation doesn't help. And "chain" is docum

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 8/15/2013 2:24 PM, R. David Murray wrote: > On Thu, 15 Aug 2013 14:10:39 -0400, "Eric V. Smith" > wrote: >> On 08/15/2013 01:58 PM, Mark Dickinson wrote: >>> On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano >> > wrote: >>> >>> >>> - Each scheme ended up needing

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eli Bendersky
> > > > And I guess this is subjective: conversely, the API you're proposing > > > doesn't feel Pythonic to me. :-) I'd like the hear the opinion of > other > > > python-dev readers. > > > > I agree with Mark: the proposed median, median.low, etc., doesn't feel > > right. Is there any example of

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Antoine Pitrou
On Thu, 15 Aug 2013 14:24:50 -0400 "R. David Murray" wrote: > On Thu, 15 Aug 2013 14:10:39 -0400, "Eric V. Smith" > wrote: > > On 08/15/2013 01:58 PM, Mark Dickinson wrote: > > > On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano > > > wrote: > > > > > > > > > -

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread R. David Murray
On Thu, 15 Aug 2013 14:10:39 -0400, "Eric V. Smith" wrote: > On 08/15/2013 01:58 PM, Mark Dickinson wrote: > > On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano > > wrote: > > > > > > - Each scheme ended up needing to be a separate function, for ease > > of bo

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 08/15/2013 01:58 PM, Mark Dickinson wrote: > On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano > wrote: > > > - Each scheme ended up needing to be a separate function, for ease > of both implementation and testing. So I had four private median > function

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
On Thu, Aug 15, 2013 at 6:48 PM, Ryan wrote: > For the naming, how about changing median(callable) to median.regular? > That way, we don't have to deal with a callable namespace. > Hmm. That sounds like a step backwards to me: whatever the API is, a simple "from statistics import median; m = m

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Ryan
For the naming, how about changing median(callable) to median.regular? That way, we don't have to deal with a callable namespace. Steven D'Aprano wrote: >On 15/08/13 21:42, Mark Dickinson wrote: >> The PEP and code look generally good to me. >> >> I think the API for median and its variants des

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano wrote: > > - Each scheme ended up needing to be a separate function, for ease of both > implementation and testing. So I had four private median functions, which I > put inside a class to act as namespace and avoid polluting the main > namespace. Th

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Steven D'Aprano
On 15/08/13 21:42, Mark Dickinson wrote: The PEP and code look generally good to me. I think the API for median and its variants deserves some wider discussion: the reference implementation has a callable 'median', and variant callables 'median.low', 'median.high', 'median.grouped'. The pattern

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
On Thu, Aug 15, 2013 at 2:25 AM, Steven D'Aprano wrote: > Can I request that people please look at this issue, with an aim to ruling > on the PEP and (hopefully) adding the module to 3.4 before feature freeze? > If it is accepted, I am willing to be primary maintainer for this module in > the futu

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Steven D'Aprano
On 15/08/13 11:49, Terry Reedy wrote: On 8/14/2013 9:25 PM, Steven D'Aprano wrote: The tests aren't yet integrated with the test runner but are runnable manually. What do you mean? With the changes I gave you, they run fine as part of the test suite. I'm sorry Terry, at the time I posted I

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
The PEP and code look generally good to me. I think the API for median and its variants deserves some wider discussion: the reference implementation has a callable 'median', and variant callables 'median.low', 'median.high', 'median.grouped'. The pattern of attaching the variant callables as attr

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-14 Thread Terry Reedy
On 8/14/2013 9:25 PM, Steven D'Aprano wrote: The tests aren't yet integrated with the test runner but are runnable manually. What do you mean? With the changes I gave you, they run fine as part of the test suite. -- Terry Jan Reedy ___ Python-Dev

[Python-Dev] PEP 450 adding statistics module

2013-08-14 Thread Steven D'Aprano
Hi all, I have raised a tracker item and PEP for adding a statistics module to the standard library: http://bugs.python.org/issue18606 http://www.python.org/dev/peps/pep-0450/ There has been considerable discussion on python-ideas, which is now reflected by the PEP. I've signed the Contribut