[Numpy-discussion] Median again

Alexander Michael lxander.m@gmail....
Tue Jan 29 12:16:04 CST 2008


On Jan 29, 2008, at 11:51 AM, Joris De Ridder wrote:
> This feature request has been repeatedly asked before (e.g. 6 months
> ago). The relevant ticket (#558, although this only asks for axis
> support) mentions a milestone 1.1. I would like to ask if it could be
> moved somewhat higher on the priority list.
>
> I provided some code for axis support (see ticket), which I largely
> copied from the Scipy version back then. I suspect there are many
> other people who also implemented their own customized median()
> function that has axis support.
>
>> median moved mediandim0
>> implementation of medianwithaxis or similar, with same call
>> signature as mean.
>>
>> Deprecation warning for use of median, and return of mediandim0 for
>> now.  Eventual move of median to return medianwithaxis.
>
> This would confuse people even more, I'm afraid. First they're said
> that median() is deprecated, and then later on it becomes the standard
> function to use. I would actually prefer a short pain rather than a
> long one.

I would certainly like median to take the axis keyword. The axis  
keyword (and its friends) could be added to 1.0.5 with the default  
being 1 instead of None, so that it keeps compatibility with the 1.0  
API. Then, with 1.1 (an API-breaking release) the default can be  
changed to None to restore consistency with mean, etc.


More information about the Numpy-discussion mailing list