[Numpy-discussion] Medians that ignore values

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Sep 22 07:05:12 CDT 2008


Peter Saffrey wrote:
>
> I've found that if I just cut nans from the list and use regular numpy median,
> it is quicker - 10 times slower than list median, rather than 35 times slower.
> Could you just wire nanmedian to do it this way? 

Unfortunately, we can't, because we would loose generality: we need to
compute median on any axis, not only the last one. The proper solution
would be to have a sort/max/min/etc... which knows about nan in numpy,
which is what Chuck and I are working on ATM,

cheers,

David


More information about the Numpy-discussion mailing list