[Numpy-discussion] Median advice

Matthew Brett matthew.brett at gmail.com
Tue Feb 12 16:09:11 EST 2008


Hi,

On Feb 12, 2008 8:48 PM, Anne Archibald <peridot.faceted at gmail.com> wrote:
> On 12/02/2008, Matthew Brett <matthew.brett at gmail.com> 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 lot more
> difference to the runtime (and memory usage) than an output array.

Yes, true.  I'll include it unless anyone pipes up to object.

Matthew



More information about the NumPy-Discussion mailing list