Re: [Numpy-discussion] Median advice

2008-02-13 Thread Gael Varoquaux
On Tue, Feb 12, 2008 at 09:09:11PM +, Matthew Brett wrote: > > > Suggestion 1: > > > def median(a, axis=0, out=None) > > [...] > > > Suggestion 2: > > > def median(a, axis=0, scratch_input=False) > > No reason not to combine the two. It's a pretty straightforward > > modification to do the sor

Re: [Numpy-discussion] Median advice

2008-02-12 Thread Matthew Brett
Hi, On Feb 12, 2008 8:48 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > On 12/02/2008, Matthew Brett <[EMAIL PROTECTED]> wrote: > > > Suggestion 1: > > def median(a, axis=0, out=None) > [...] > > Suggestion 2: > > def median(a, axis=0, scratch_input=False) > > No reason not to combine the two. It

Re: [Numpy-discussion] Median advice

2008-02-12 Thread Anne Archibald
On 12/02/2008, Matthew Brett <[EMAIL PROTECTED]> wrote: > Suggestion 1: > def median(a, axis=0, out=None) [...] > Suggestion 2: > def median(a, axis=0, scratch_input=False) No reason not to combine the two. It's a pretty straightforward modification to do the sorting in place, and it could make a

Re: [Numpy-discussion] Median advice

2008-02-12 Thread Robert Kern
On Feb 12, 2008 6:33 AM, Joris De Ridder <[EMAIL PROTECTED]> wrote: > > On 12 Feb 2008, at 12:31, Matthew Brett wrote: > > > def median(a, axis=0, out=None) > > (same signature as max, min etc) > > I would be slightly in favour of this option. > Using the same signature would be convenient in code

Re: [Numpy-discussion] Median advice

2008-02-12 Thread Joris De Ridder
On 12 Feb 2008, at 12:31, Matthew Brett wrote: > def median(a, axis=0, out=None) > (same signature as max, min etc) I would be slightly in favour of this option. Using the same signature would be convenient in code like def myfunc(myarray, somefunc): # do stuff ... x =

[Numpy-discussion] Median advice

2008-02-12 Thread Matthew Brett
Hi, I'm just doing the median implementation. This is just to pull together a couple of threads, about what the call signature, behavior should be. We've already established that we're going to leave the default behavior of taking the median over the first axis, even though it differs from that